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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How do I generate test rows increments by 1 sec

Author  Topic 

nhuanlieu
Starting Member

27 Posts

Posted - 2009-09-14 : 16:12:18
I used the following, but I am missing the incremental part some where so I can produce 10 unique records. Thanks.

SELECT TOP 10 DATEADD(ms,1,getdate()) FROm AdventureWorks.Person.StateProvince

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2009-09-14 : 16:15:16
Here's one way:

select dateadd(second, number, getdate())
from master..spt_values
where type = 'P'
and number < 10


Be One with the Optimizer
TG
Go to Top of Page

nhuanlieu
Starting Member

27 Posts

Posted - 2009-09-14 : 17:30:02
That's what I needed. Thanks as it worked very well.
Go to Top of Page
   

- Advertisement -