Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DECLARE @counter INT
- DECLARE @ilosc int
- DECLARE @prodNum varchar(20)
- SET @counter = 0
- WHILE @counter < 10
- BEGIN
- SET @ilosc = (select FLOOR(RAND()*100))
- SET @prodNum = (select TOP 1 ProduktNumer from Produkt Order by NEWID())
- insert into Sprzedaz values(
- (select TOP 1 KlientId from Klient Order by NEWID()),
- (select @prodNum),
- (select @ilosc),
- ((select @ilosc)*(select TOP 1 Cena from Produkt where ProduktNumer = @prodNum)),
- DEFAULT
- )
- SET @counter = @counter + 1
- END
Add Comment
Please, Sign In to add comment