Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

compound primary key

0 views
Skip to first unread message

Lez

unread,
Nov 2, 2009, 3:32:31 AM11/2/09
to
Hi Guys,

Just some advice on how to create a 'compound primary key' in slq2005 please

My scheme is currently:

CREATE TABLE [dbo].[DS_Shipment](
[shipmentID] [int] IDENTITY(1,1) NOT NULL,
[invoiceID] [int] NULL,
[shipmentdate] [smalldatetime] NULL,
[shipcode] [nchar](10) NULL,
[notes] [nvarchar](255) NULL,
[trackingnumber] [nvarchar](20) NULL,
CONSTRAINT [PK_DS_Shipment] PRIMARY KEY CLUSTERED
(

Thanks
Lez


Uri Dimant

unread,
Nov 2, 2009, 4:55:52 AM11/2/09
to
Lez

CREATE TABLE [dbo].[DS_Shipment]

(

[shipmentID] [int] IDENTITY(1,1) NOT NULL,

[invoiceID] [int] NOT NULL,

[shipmentdate] [smalldatetime] NULL,

[shipcode] [nchar](10) NULL,

[notes] [nvarchar](255) NULL,

[trackingnumber] [nvarchar](20) NULL,

CONSTRAINT [PK_DS_Shipment] PRIMARY KEY ([shipmentID],[invoiceID])

)

"Lez" <lez_nospam_@/noSpam\hotmail.co.uk> wrote in message
news:4EEA7078-933E-4E76...@microsoft.com...

Lez

unread,
Nov 3, 2009, 5:03:10 AM11/3/09
to
Cheers Uri,

Thanks for that

Lez

"Uri Dimant" <ur...@iscar.co.il> wrote in message
news:OsOV9J6W...@TK2MSFTNGP02.phx.gbl...

0 new messages