金蝶专业版16.0保存凭证提示 无法建立数据库,或者对象名"VoucherEntry 无效
问题:金蝶kis专业版16.0保存凭证时提示 无法建立数据库,或者
保存凭证时弹出对象名"VoucherEntry 无效
问题原因:由于数据库中 t_voucherentry 表中丢失索引导致
解决方法:
先把帐套备份后,请参考如下方法处理:
第一,在SQL查询分析器中选择问题帐套,备份表t_voucherentry 数据到 temp1 表(直接在坏的这个数据库里面执行下面这个语句就可以)
Select * into temp1 from t_voucherentry(说明意思:在数据库里新建temp1这张表 并且把t_voucherentry里面的数据导入到temp1里面)
第二部,删除 t_voucherentry 表,(执行下面语句)
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[t_VoucherEntry]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[t_VoucherEntry]
第三部,创建一张t_VoucherEntry表(执行以下语句即可)
CREATE TABLE [dbo].[t_VoucherEntry] (
[FBrNo] [varchar] (10) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[FVoucherID] [int] NOT NULL ,
[FEntryID] [int] NOT NULL ,
[FExplanation] [varchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[FAccountID] [int] NOT NULL ,
[FDetailID] [int] NOT NULL ,
[FCurrencyID] [int] NOT NULL ,
[FExchangeRate] [float] NOT NULL ,
[FDC] [smallint] NOT NULL ,
[FAmountFor] [money] NOT NULL ,
[FAmount] [money] NOT NULL ,
[FQuantity] [float] NOT NULL ,
[FMeasureUnitID] [int] NOT NULL ,
[FUnitPrice] [float] NOT NULL ,
[FInternalInd] [varchar] (10) COLLATE Chinese_PRC_CI_AS NULL ,
[FAccountID2] [int] NOT NULL ,
[FSettleTypeID] [int] NOT NULL ,
[FSettleNo] [varchar] (40) COLLATE Chinese_PRC_CI_AS NULL ,
[FTransNo] [varchar] (100) COLLATE Chinese_PRC_CI_AS NULL ,
[FCashFlowItem] [int] NOT NULL ,
[FTaskID] [int] NOT NULL ,
[FResourceID] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[t_VoucherEntry] WITH NOCHECK ADD
CONSTRAINT [PK_VoucherEntry] PRIMARY KEY CLUSTERED
(
[FVoucherID],
[FEntryID]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[t_VoucherEntry] ADD
CONSTRAINT [DF__t_Voucher__FBrNo__4D5F7D71] DEFAULT ('0') FOR [FBrNo],
CONSTRAINT [DF__t_Voucher__FDeta__4E53A1AA] DEFAULT (0) FOR [FDetailID],
CONSTRAINT [DF__t_Voucher__FQuan__4F47C5E3] DEFAULT (0) FOR [FQuantity],
CONSTRAINT [DF__t_Voucher__FMeas__503BEA1C] DEFAULT (0) FOR [FMeasureUnitID],
CONSTRAINT [DF__t_Voucher__FUnit__51300E55] DEFAULT (0) FOR [FUnitPrice],
CONSTRAINT [DF__t_Voucher__FAcco__5224328E] DEFAULT (0) FOR [FAccountID2],
CONSTRAINT [DF__t_Voucher__FSett__531856C7] DEFAULT (0) FOR [FSettleTypeID],
CONSTRAINT [DF__t_Voucher__FCash__540C7B00] DEFAULT (0) FOR [FCashFlowItem],
CONSTRAINT [DF__t_Voucher__FTask__55009F39] DEFAULT (0) FOR [FTaskID],
CONSTRAINT [DF__t_Voucher__FReso__55F4C372] DEFAULT (0) FOR [FResourceID]
GO
CREATE INDEX [ix_VoucherEntry_1] ON [dbo].[t_VoucherEntry]([FAccountID]) ON [PRIMARY]
GO
CREATE INDEX [ix_VoucherEntry_2] ON [dbo].[t_VoucherEntry]([FCurrencyID]) ON [PRIMARY]
GO
CREATE INDEX [ix_VoucherEntry_3] ON [dbo].[t_VoucherEntry]([FDetailID]) ON [PRIMARY]
GO
第四部,插回凭证表中的数据
Insert into t_voucherentry select * from temp1
第四,删除这张临时表 temp1
Drop table temp1
完毕。亲测
金蝶专业版16.0保存凭证提示 无法建立数据库,或者对象名"VoucherEntry 无效
本文2024-09-16 19:20:36发表“kis知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-kis-27992.html