Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modify Primary Key
Message
From
15/09/2005 10:41:21
 
 
To
14/09/2005 23:40:44
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01049725
Message ID:
01049876
Views:
11
A great example on why you should use surrogate keys, such as an AutoInc, instead of natural keys. No need to change the PK.


>Hi,
>I have table as below with PK crefdoc+nsn, how could I change the PK to crefdoc+cbzunit using T-SQL?
>
>
CREATE TABLE [dbo].[fbzplnd] (
>	[crefdoc] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
>	[nsn] [decimal](3, 0) NOT NULL ,
>	[cbzunit] [char] (6) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
>	[nvalue] [decimal](10, 2) NOT NULL
>) ON [PRIMARY]
>
>Thank you
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform