CREATE TABLE [dbo].[INVS_ITEM_LOCATIONS]
([DEPARTMENT_CODE] [varchar](3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[IM_INV_NO] [numeric](10, 0) NOT NULL,
[LOCATION_CODE] [varchar](2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CURR_QTY] [numeric](10, 0) NOT NULL CONSTRAINT [DF__INVS_ITEM__CURR___1352D76D] DEFAULT ((0)),
[DO_QTY] [numeric](10, 0) NOT NULL CONSTRAINT [DF__INVS_ITEM__DO_QT__1446FBA6] DEFAULT ((0)),
[ALLOC_QTY] [numeric](10, 0) NOT NULL CONSTRAINT [DF__INVS_ITEM__ALLOC__153B1FDF] DEFAULT ((0)),
[YOB_QTY] [numeric](10, 0) NOT NULL CONSTRAINT [DF__INVS_ITEM__YOB_Q__162F4418] DEFAULT ((0)),
[FOC_QTY] [numeric](10, 0) NULL CONSTRAINT [DF__INVS_ITEM__FOC_Q__17236851] DEFAULT ((0)),
[USER_CREATED] [varchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DATE_CREATED] [datetime] NOT NULL,
[USER_MODIFIED] [varchar](25) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DATE_MODIFIED] [datetime] NULL,
CONSTRAINT [INVS_ITEM_LOCATIONS_PK]
PRIMARY KEY CLUSTERED ([DEPARTMENT_CODE] ASC,
[IM_INV_NO] ASC, [LOCATION_CODE] ASC)
WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
這是我的表結構......我怎麼能刪除表中的複合主鍵,也我要補充外鍵im_inv_no參考表是invs_location包含im_inv_no並且department_code應該是相同的主鍵.pls幫助如何更改表的複合主鍵
請嘗試像「SQL服務器2005」的有用和相關的標籤添加到您的下一個問題的時候了。它可以讓人們更好地瞭解您正在使用的內容以及如何向您尋求幫助! – 2009-08-31 13:08:57
你打算把一些主鍵放在桌子上,對吧?如果組合鍵中的文件是獨一無二的,那麼當您至少刪除主鍵時,您應該在其上放置一個唯一索引,否則將來會出現數據完整性問題。 – HLGEM 2009-11-11 14:07:44