1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- set ansi_nulls on
- go
- set quoted_identifier on
- go
- set ansi_padding on
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'Outlay') and objectproperty(id,'IsTable') = 1)
- begin
- create table [dbo].[Outlay](
- [olid] [int] identity(1,1) not null,
- [olname] [nvarchar](24) not null,
- [olmoney] [nvarchar](24) not null,
- [oldate] [nvarchar](24) null,
- [olbz] [varchar](max) NULL,
- [renyuan1] [varchar](24) NULL,
- [renyuan2] [varchar](24) NULL,
- [financecheck] [nvarchar](10) NULL,
- [oltime] [nvarchar](12) NULL,
- [photo] [image] NULL,
- [financecheck2] [nvarchar](50) NULL,
- [financecheck3] [nvarchar](50) NULL,
- [hasphoto] [bit] default(0) NULL
- ) on [primary]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'OutlayRootConf') and objectproperty(id,'IsTable') = 1)
- begin
- create table [dbo].[OutlayRootConf](
- [olrcid] [int] identity(1,1) not null,
- [olrcname] [nvarchar](24) not null
- constraint [PK_OutlayRootConf] primary key clustered
- (
- [olrcid]
- )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on,allow_page_locks = on) on [primary],
- )on [primary]
- end
- go
- if not exists(select * from dbo.sysobjects where id = object_id(N'OutlaySubConf') and objectproperty(id,'IsTable') = 1)
- begin
- create table [dbo].[OutlaySubConf](
- [olsrid] [int] not null,
- [olscid] [int] identity(1,1) not null,
- [olscname] [nvarchar](24) not null,
- constraint [PK_OutlaySubConf] primary key clustered
- (
- [olscid]
- )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on,allow_page_locks = on) on [primary],
- )on [primary]
- end
- go
- alter table OutlaySubConf
- with check add constraint [FK_OutlaySubConf] foreign key(olsrid)
- references OutlayRootConf (olrcid)
- go
- drop table [OutlaySubConf]
- drop table [OutlayRootConf]
|