問題現(xiàn)象:(11.510.000.0000)升級賬套出錯:CS_BankCashAccessVoucher' 已經有針對它定義的主鍵

升級出錯,錯誤信息:升級腳本出錯,錯誤信息:SQL 腳本: 11.510.000.0000 DATA_DSTR_FI_Vou_NL.sql 出錯:表 'CS_BankCashAccessVoucher' 已經有針對它定義的主鍵。

解決方案:提示哪個表就刪除哪個表的主鍵,語句如下,不能全部執(zhí)行。(操作前請備份好您用友T+財務軟件中的數(shù)據(jù),可參考教程:http://bainianle.cn/jcufida/1389.html

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_BankCashAccessVoucher]') AND name = N'PK_CS_BankCashAccessVoucher')

ALTER TABLE [dbo].[CS_BankCashAccessVoucher] DROP CONSTRAINT [PK_CS_BankCashAccessVoucher]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_CashAccountPeriodBeginning_b]') AND name = N'PK_CS_CashAccountPeriodBeginning_b')

ALTER TABLE [dbo].[CS_CashAccountPeriodBeginning_b] DROP CONSTRAINT [PK_CS_CashAccountPeriodBeginning_b]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_ExpenseVoucher_b]') AND name = N'PK_CS_ExpenseVoucher_b')

ALTER TABLE [dbo].[CS_ExpenseVoucher_b] DROP CONSTRAINT [PK_CS_ExpenseVoucher_b]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_ExpenseVoucher_MultiSettle]') AND name = N'PK_CS_ExpenseVoucher_MultiSettle')

ALTER TABLE [dbo].[CS_ExpenseVoucher_MultiSettle] DROP CONSTRAINT [PK_CS_ExpenseVoucher_MultiSettle]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_ExpenseVoucher]') AND name = N'PK_CS_ExpenseVoucher')

ALTER TABLE [dbo].[CS_ExpenseVoucher] DROP CONSTRAINT [PK_CS_ExpenseVoucher]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_IncomeVoucher_b]') AND name = N'PK_CS_IncomeVoucher_b')

ALTER TABLE [dbo].[CS_IncomeVoucher_b] DROP CONSTRAINT [PK_CS_IncomeVoucher_b]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_IncomeVoucher_MultiSettle]') AND name = N'PK_CS_IncomeVoucher_MultiSettle')

ALTER TABLE [dbo].[CS_IncomeVoucher_MultiSettle] DROP CONSTRAINT [PK_CS_IncomeVoucher_MultiSettle]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[CS_IncomeVoucher]') AND name = N'PK_CS_IncomeVoucher')

ALTER TABLE [dbo].[CS_IncomeVoucher] DROP CONSTRAINT [PK_CS_IncomeVoucher]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_Detail]') AND name = N'PK_ARAP_Detail')

ALTER TABLE [dbo].[ARAP_Detail] DROP CONSTRAINT [PK_ARAP_Detail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ExchangeAdjust]') AND name = N'PK_ARAP_ExchangeAdjust')

ALTER TABLE [dbo].[ARAP_ExchangeAdjust] DROP CONSTRAINT [PK_ARAP_ExchangeAdjust]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ExchangeAdjust_ApDetail]') AND name = N'PK_ARAP_ExchangeAdjust_ApDetail')

ALTER TABLE [dbo].[ARAP_ExchangeAdjust_ApDetail] DROP CONSTRAINT [PK_ARAP_ExchangeAdjust_ApDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ExchangeAdjust_ArDetail]') AND name = N'PK_ARAP_ExchangeAdjust_ArDetail')

ALTER TABLE [dbo].[ARAP_ExchangeAdjust_ArDetail] DROP CONSTRAINT [PK_ARAP_ExchangeAdjust_ArDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_OriginalAmount]') AND name = N'PK_ARAP_OriginalAmount')

ALTER TABLE [dbo].[ARAP_OriginalAmount] DROP CONSTRAINT [PK_ARAP_OriginalAmount]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_OriginalAmount_ApDetail]') AND name = N'PK_ARAP_OriginalAmount_ApDetail')

ALTER TABLE [dbo].[ARAP_OriginalAmount_ApDetail] DROP CONSTRAINT [PK_ARAP_OriginalAmount_ApDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_OriginalAmount_ArDetail]') AND name = N'PK_ARAP_OriginalAmount_ArDetail')

ALTER TABLE [dbo].[ARAP_OriginalAmount_ArDetail] DROP CONSTRAINT [PK_ARAP_OriginalAmount_ArDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ReceivePayment]') AND name = N'PK_ARAP_ReceivePayment')

ALTER TABLE [dbo].[ARAP_ReceivePayment] DROP CONSTRAINT [PK_ARAP_ReceivePayment]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ReceivePayment_b]') AND name = N'PK_ARAP_ReceivePayment_b')

ALTER TABLE [dbo].[ARAP_ReceivePayment_b] DROP CONSTRAINT [PK_ARAP_ReceivePayment_b]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ReceivePayment_MultiPayment]') AND name = N'PK_ARAP_ReceivePayment_MultiPayment')

ALTER TABLE [dbo].[ARAP_ReceivePayment_MultiPayment] DROP CONSTRAINT [PK_ARAP_ReceivePayment_MultiPayment]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ReceivePayment_MultiSettle]') AND name = N'PK_ARAP_ReceivePayment_MultiSettle')

ALTER TABLE [dbo].[ARAP_ReceivePayment_MultiSettle] DROP CONSTRAINT [PK_ARAP_ReceivePayment_MultiSettle]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_StrikeBalance]') AND name = N'PK_ARAP_StrikeBalance')

ALTER TABLE [dbo].[ARAP_StrikeBalance] DROP CONSTRAINT [PK_ARAP_StrikeBalance]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_StrikeBalance_FirstDetail]') AND name = N'PK_ARAP_StrikeBalance_FirstDetail')

ALTER TABLE [dbo].[ARAP_StrikeBalance_FirstDetail] DROP CONSTRAINT [PK_ARAP_StrikeBalance_FirstDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_StrikeBalance_SecondDetail]') AND name = N'PK_ARAP_StrikeBalance_SecondDetail')

ALTER TABLE [dbo].[ARAP_StrikeBalance_SecondDetail] DROP CONSTRAINT [PK_ARAP_StrikeBalance_SecondDetail]

GO

IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[ARAP_ExchangeAdjust]') AND name = N'PK_ARAP_ExchangeAdjust')

ALTER TABLE [dbo].[ARAP_ExchangeAdjust] DROP CONSTRAINT [PK_ARAP_ExchangeAdjust]

GO