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 |
cwilli35
Starting Member
17 Posts |
Posted - 2009-05-28 : 14:49:48
|
Hi All,I've created a trigger called nextnumberseq on the 'workitem' table listed below. The problem I have is that the number sequence is only updating on EACH insert as a whole and it's NOT updating each record. Can anyone tell me how to fix this?Thanks CREATE TRIGGER nextnumberseqON AltirisHDS_TEST.dbo.workitemAFTER INSERTAS update workitem_next_number SET next_number = next_number + 1 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-28 : 15:08:08
|
why do you want to do it via trigger? isnt it enough to make next_number an identity field? |
 |
|
cwilli35
Starting Member
17 Posts |
Posted - 2009-05-28 : 16:11:19
|
Visakh16 can you please explain what you mean, I'm new to this so I'm not real sure how to do this. What I'm doing is a DB migration and there are already seq numbers in the new DB, so I want the script to create the correct seq numbers for the migrated records. |
 |
|
|
|
|