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 2005 Forums
 Other SQL Server Topics (2005)
 TRIGGER ISSUES

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 nextnumberseq
ON AltirisHDS_TEST.dbo.workitem
AFTER INSERT
AS 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?
Go to Top of Page

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.
Go to Top of Page
   

- Advertisement -