6 Mart 2016 Pazar

MS SQL - While Döngüsü


DECLARE @cnt INT = 0;

WHILE @cnt < cnt_total
BEGIN
   {...statements...}
   SET @cnt = @cnt + 1;
END;

---------

DECLARE @cnt INT = 11;

WHILE @cnt < 10000
BEGIN
  INSERT INTO [dbo].[Chat]
           ([Name]
           ,[Content]
           ,[Lock]
           ,[CreatedDate]
           ,[ModifiedDate]
           ,[State]
           ,[Archive]
           ,[CreatedBy]
           ,[ModifiedBy]
           ,[Summary])
     VALUES
           ('Sohbet '+STR(@cnt)
           ,'İçerik'+STR(@cnt)
           ,0
           ,Getdate()
           ,Getdate()
           ,1
           ,0
           ,'admin'
           ,'admin'
           ,'Özet' +STR(@cnt))
   SET @cnt = @cnt + 1;
END;
GO

Hiç yorum yok:

Yorum Gönder

.net 6 mapget kullanımı

 app.UseEndpoints(endpoints => {     endpoints.MapGet("/", async context =>     {         var response = JsonConvert.Seriali...