Hello everybody,
I've been trying to write a script to populate a table.
One filed is of 'date' type and I would like to insert dates different from record to record.
I thought about creating a loop and then try to increment the day (or the hour, I don'care) by using the loop index.
There comes of course a problem of casting from integers to strings (or date).
I tried to do something like:
DECLARE @K INT
WHILE(@K<10)
BEGIN
INSERT INTO TABLE1 (DATETIME) VALUES ('20071026 11:'||CAST(@K AS VARCHAR)||'00')
SET @K=@K+1
END
but it didn't work ...
Would you please suggest a method of performing this action?
Thanks in advance,
Stefano.