|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册账号
×
执行语句之前先做好数据备份,以防数据丢失。
先建立新帐,替换以下 ufdata_666_2011(注意有3处要修改),然后再 有问题帐套下执行该语句,限2005数据库
if exists(select * from sysobjects where name='Rpt_FltDEF' and xtype='U')
drop table Rpt_FltDEF
CREATE TABLE [dbo].[Rpt_FltDEF](
[ID_Flt] [int] IDENTITY(1,1) NOT NULL,
[Location] [int] NULL,
[ID] [int] NULL,
[Name] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[Note] [varchar](32) COLLATE Chinese_PRC_CI_AS NULL,
[Expression] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[ModeEx] [int] NULL,
[IsSingle] [smallint] NULL,
[Flag] [smallint] NULL,
[Caption] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[iLeft] [int] NULL DEFAULT (0),
[iTop] [int] NULL DEFAULT (0),
[iWidth] [int] NULL DEFAULT (0),
[iHeight] [int] NULL DEFAULT (0),
[iCaptionLeft] [int] NULL DEFAULT (0),
[iCaptionWidth] [int] NULL DEFAULT (0),
[iPage] [int] NOT NULL DEFAULT (0),
[iRefSelect] [int] NOT NULL DEFAULT (0),
CONSTRAINT [Rpt_FltDEF_PK] PRIMARY KEY CLUSTERED
(
[ID_Flt] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
insert into Rpt_FltDEF(Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,
Caption,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect)
select Location,ID,Name,Note,Expression,ModeEx,IsSingle,Flag,
Caption,iLeft,iTop,iWidth,iHeight,iCaptionLeft,iCaptionWidth,iPage,iRefSelect from ufdata_666_2011..Rpt_FltDEF
if exists(select * from sysobjects where name='Rpt_FldDEF' and xtype='U')
drop table Rpt_FldDEF
CREATE TABLE [dbo].[Rpt_FldDEF](
[ID_Field] [int] IDENTITY(1,1) NOT NULL,
[ID] [int] NULL,
[Name] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[Expression] [varchar](512) COLLATE Chinese_PRC_CI_AS NULL,
[Condition] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[ModeEx] [int] NULL,
[OrderEx] [int] NULL,
[TopEx] [int] NULL,
[LeftEx] [int] NULL,
[Width] [int] NULL,
[Height] [int] NULL,
[Visible] [int] NULL,
[Note] [varchar](32) COLLATE Chinese_PRC_CI_AS NULL,
[nameForeign] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[iColSize] [int] NULL,
[FormatEx] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
[iAlignStyle] [int] NULL,
[iSize] [int] NULL,
CONSTRAINT [PK_Rpt_FldDEF] PRIMARY KEY CLUSTERED
(
[ID_Field] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
insert into Rpt_FldDEF(ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,Note,nameForeign,iColSize,
FormatEx,iAlignStyle,iSize)
select ID,Name,Expression,Condition,ModeEx,OrderEx,TopEx,LeftEx,Width,Height,Visible,Note,nameForeign,iColSize,
FormatEx,iAlignStyle,iSize from ufdata_666_2011..Rpt_FldDEF
if exists(select * from sysobjects where name='Rpt_GlbDEF' and xtype='U')
drop table Rpt_GlbDEF
CREATE TABLE [dbo].[Rpt_GlbDEF](
[ID] [int] IDENTITY(1,1) NOT NULL,
[SystemID] [varchar](16) COLLATE Chinese_PRC_CI_AS NULL,
[Name] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[Title] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[DatabaseEx] [varchar](128) COLLATE Chinese_PRC_CI_AS NULL,
[WhereEx] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[Predicate] [varchar](20) COLLATE Chinese_PRC_CI_AS NULL,
[Type] [smallint] NULL,
[Relation] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[Note] [varchar](255) COLLATE Chinese_PRC_CI_AS NULL,
[Cols] [int] NULL,
[Section] [int] NULL,
[Fields] [int] NULL,
[DataSource] [text] COLLATE Chinese_PRC_CI_AS NULL,
[BaseTable] [varchar](64) COLLATE Chinese_PRC_CI_AS NULL,
[IsBaseTable] [bit] NULL,
[IsControlCreate] [bit] NULL,
[IsBase] [bit] NULL,
[GroupDefine] [varchar](16) COLLATE Chinese_PRC_CI_AS NULL,
CONSTRAINT [PK_Rpt_GlbDEF] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
--TRUNCATE TABLE Rpt_GlbDEF
set IDENTITY_INSERT Rpt_GlbDEF on
insert into Rpt_GlbDEF(ID,SystemID,Name,Title,DatabaseEx,WhereEx,Predicate,Type,Relation,
Note,Cols,Section,Fields,DataSource,BaseTable,IsBaseTable,IsControlCreate,IsBase,GroupDefine)
select ID,SystemID,Name,Title,DatabaseEx,WhereEx,Predicate,Type,Relation,
Note,Cols,Section,Fields,DataSource,BaseTable,IsBaseTable,IsControlCreate,IsBase,GroupDefine
from ufdata_666_2011..Rpt_GlbDEF
set IDENTITY_INSERT Rpt_GlbDEF off
if exists(select * from sysobjects where name='RPT_ExtCol' and xtype='U')
drop table RPT_ExtCol
CREATE TABLE [dbo].[RPT_ExtCol](
[Auto_id] [int] IDENTITY(1,1) NOT NULL,
[RPT_ID] [int] NOT NULL,
[cCaption] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,
[cDOName] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[cCondition] [nvarchar](255) COLLATE Chinese_PRC_CI_AS NOT NULL,
[cDOColumn] [varchar](50) COLLATE Chinese_PRC_CI_AS NOT NULL,
[bEnable] [bit] NOT NULL
) ON [PRIMARY]
|
|