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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Sequences whitout identity?

Author  Topic 

netram
Starting Member

2 Posts

Posted - 2006-02-03 : 05:02:24
I have several datasources with diffrent keys , I load these into diffrent temp tables and after that I merge these into one table , the problem is that I dont want to have a thousand colums and I dont want to use an udf style table to keep the number of columns down.

What I want to do is to assign a uniqe sequence to the transaktions in the temp tables , the sequence should be the same for all the diffrent temp tables. Then I can load a highly normalized table and use the sequence as a relation key to tables uniqe for the diffrent datasources.
In oracle this would be simple just using a db sequence but how to do this in t-sql whitout dabling with cursors and updates?

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-02-03 : 05:08:55
so what's wrong with using identity?

Go with the flow & have fun! Else fight the flow
Go to Top of Page

netram
Starting Member

2 Posts

Posted - 2006-02-03 : 05:17:32
Well , I cant use identity in the temp tables since I will use the sequence as a uniqe key in the 'merge' table , and if I use identity in the 'merge' table I will need to extract the identity from the 'merge' table to use in relations which will unpractical since I dont have any natural key in the table (thats why I want to create the sequence).
Go to Top of Page
   

- Advertisement -