/ Published in: SQL
This loop adds a bunch of records to your database with a date field pre-populated. Works well for pre-populating a table for filling out daily by a form
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
DECLARE @imax INT, @i INT SET @imax = 400 -- change to max value SET @i = 1 while (@i <= @imax) BEGIN INSERT INTO Workflow_status (WF_date)VALUES (CONVERT(DATE, getdate() + @i,101)) SET @i = @i + 1 END