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)
 Change PK data in row

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2007-09-25 : 07:45:21
Hi i want to update a single column of data that is part of a PK is this possible to do, the only way i can see how to do it, it to remove the PK change the data and reset the PK, but i don't think this is the correct way of doing it.

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-09-25 : 08:37:40
Are there foreign keys associated to this PK? If so, enable CASCADE UPDATE before updating.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-09-25 : 08:56:55
You can update data that is part of a primary key. If the column is defined as an IDENTITY column, you will need to issue SET IDENTITY INSERT ON before your update, and SET IDENTITY INSERT OFF immediately afterwards.

e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -