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 |
sg2255551
Constraint Violating Yak Guru
274 Posts |
Posted - 2012-02-16 : 00:23:43
|
hiHow do I generate row number starting from 1000?I have a CTE code but it won't work. thanks a lotWith productIndex AS (Select IDENTITY(int,1000,1) as RN, Distinct(ProdID) as ProdIDFROM dbo.Product )Select * from productIndex |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2012-02-16 : 01:22:44
|
use row_number() over ( order by ...) + 1000 KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|