Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Modify Primary Key
Message
De
15/09/2005 10:41:21
 
 
À
14/09/2005 23:40:44
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01049725
Message ID:
01049876
Vues:
10
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform