Hi
We can archive the Loop statement in SQL. Here is some Example
For SQL Server
Code:
DECLARE @CNT INT
DECLARE @Q NVARCHAR(1000)
SET @CNT = 100
WHILE(@CNT < 1000)
BEGIN
SET @Q = 'Insert into infostorageCompanies
Values(' + CAST (@CNT AS NVARCHAR) + ',' + '''testCompany_9''' + ',' + '''''' + ',' + '''''' + ')'
PRINT @Q
EXEC sp_executesql @Q
SET @CNT = @CNT + 100
END For MS SQL
Code:
declare @i int
while (@i<10)
begin
insert into dbname.dbo.table_name values @i
@i=@i+1
end
For MySql
Code:
declare @i int
while (@i<10)
begin
insert into dbname.dbo.table_name values @i
@i=@i+1
end
Regards
Falcon
