Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ConradK
Posting Yak Master
140 Posts |
Posted - 2010-09-12 : 15:52:06
|
| create table #crazy(hi varchar(max))declare @x intset @x = 1while @x < 5insert into #crazyselect cast(@X as varchar) + CAST(getdate() as varchar) set @x = @x+1 What the he$$ is WRONG with this? |
|
|
ConradK
Posting Yak Master
140 Posts |
Posted - 2010-09-12 : 16:01:00
|
| ah, I needed a begin and end statement :-P |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-09-16 : 13:06:35
|
you can simply doinsert into #crazyselect cast(number as varchar) + CAST(getdate() as varchar) from master..spt_valueswhere type='p'and number between 1 and 5 to avoid the loop------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|