CREATE TABLE Department ( DepartID INT NOT NULL primary key , DepartName VARCHAR(30) ) CREATE TABLE Employees (EmployeeNO INT NOT NULL Primary Key, EmpName VARCHAR(10), EmpID CHAR(10) UNIQUE, HireDT DATETIME, DepartID INT References Department(DepartID) ) ------------------------------------------------------------------------ USE [DBSchema] GO /****** Object: Table [dbo].[TAllTypes2005] Script Date: 06/02/2009 00:18:39 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TAllTypes2005]( [FRID] [bigint] NOT NULL, [FBigInt] [bigint] NULL, [FBinary] [binary](50) NULL, [FBit] [bit] NULL, [FChar10] [char](10) NULL, [FDatetime] [datetime] NULL, [FDecimal180] [decimal](18, 0) NULL, [FDecimal184] [decimal](18, 4) NULL, [FFloag] [float] NULL, [FImage] [image] NULL, [FInt] [int] NULL, [FMoney] [money] NULL, [FNChar10] [nchar](10) NULL, [FNText] [ntext] NULL, [FNumeric180] [numeric](18, 0) NULL, [FNumeric184] [numeric](18, 4) NULL, [FNVarChar50] [nvarchar](50) NULL, [FNVarCharMax] [nvarchar](max) NULL, [FReal] [real] NULL, [FSmallDatetime] [smalldatetime] NULL, [FSmallInt] [smallint] NULL, [FSmallMoney] [smallmoney] NULL, [FSql_Variant] [sql_variant] NULL, [FText] [text] NULL, [FTimeStamp] [timestamp] NULL, [FTinyInt] [tinyint] NULL, [FUniqueIdentifier] [uniqueidentifier] NULL, [FVarBinary50] [varbinary](50) NULL, [FVarBinaryMax] [varbinary](max) NULL, [FVarChar50] [varchar](50) NULL, [FVarCharMax] [varchar](max) NULL, [FXml] [xml] NULL, CONSTRAINT [PK_TAllTypes2005] PRIMARY KEY CLUSTERED ( [FRID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO SET ANSI_PADDING OFF ------------------------------------------------------- ¡¼Create Table 1 USE [db357T] GO /****** Object: Table [dbo].[TScuUser] Script Date: 08/26/2007 18:07:54 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[TScuEMailMember]( [FEMail] [nvarchar](60) not NULL, [FUserID] [nchar](20) NOT NULL, [FUpdUser] [nchar](20) NULL, [FUpdTime] [datetime] NULL CONSTRAINT [DF_TScuEMailMember_FUpdTime] DEFAULT (getdate()), [FCreateUser] [nchar](20) NULL, [FCreateTime] [datetime] NULL CONSTRAINT [DF_TScuEMailMember_FCreateTime] DEFAULT (getdate()), CONSTRAINT [PK_TScuEMailMember] PRIMARY KEY CLUSTERED ( [FEMail] ASC ) ON [PRIMARY] ) ON [PRIMARY] GO ¡¼Create Table 2 if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[TVolumeSum0612]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table [dbo].[TVolumeSum0612] GO CREATE TABLE [dbo].[TVolumeSum0612] ( [FType] [char] (10) NOT NULL , [FYear] [int] NOT NULL , [FMonth] [int] NOT NULL , [FLevel] [char] (2) NOT NULL , [FVIP] [char] (1) NOT NULL , [FPoint] [decimal](8, 2) NOT NULL , [FCount] [int] NOT NULL ) ON [PRIMARY] GO ¡¼Create Table 3 USE [SDKDW] GO /****** Object: Table [dbo].[TBL_Customer_Cancellation] Script Date: 05/16/2007 09:24:46 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TBL_Customer_Cancellation]( [SA_SS] [char](13) COLLATE Chinese_Taiwan_Stroke_CI_AS NOT NULL, [Cancel_Month] [datetime] NOT NULL, [Cust_IDEN] [numeric](12, 0) NULL, [PC_Date] [datetime] NULL, [Reactive_Flag] [char](1) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [Enroll_Months] [int] NULL, [Enroll_Type] [varchar](10) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [Enroll_Store] [varchar](10) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [Active_Status] [char](2) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [Cancel_Type] [char](1) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [Cancel_SubType] [char](10) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [BO_Count] [decimal](9, 0) NULL, [OrdCount_NoBO] [decimal](9, 0) NULL, [OrdAmt_NoBO] [decimal](9, 0) NULL, [OrdBP_NoBO] [decimal](9, 0) NULL, [OrdCount_WithBO] [decimal](9, 0) NULL, [OrdAmt_WithBO] [decimal](9, 0) NULL, [OrdBP_WithBO] [decimal](9, 0) NULL, [LastActiveMonth] [datetime] NULL, [FWorkFlag] [varchar](10) COLLATE Chinese_Taiwan_Stroke_CI_AS NULL, [FCreateTime] [datetime] NULL, CONSTRAINT [PK_TBL_Customer_Cancellation] PRIMARY KEY CLUSTERED ( [Cancel_Month] ASC, [SA_SS] ASC ) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF ¡¼Create Table: Default getdate() USE [db357T] GO /****** Object: Table [dbo].[TApplyMember] Script Date: 01/12/2008 15:17:46 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[TSCUEmailMember]( [FEMail] [varchar](60) NOT NULL, [FActivateKey] [varchar](10) NULL, [FApplyTime] [datetime] NULL, [FConfirmTime] [datetime] NULL, [FStatus] [char](1) NULL, [FUpdUser] [nchar](20) NULL, [FUpdTime] [datetime] NULL DEFAULT (getdate()), [FCreateUser] [nchar](20) NULL, [FCreateTime] [datetime] NULL DEFAULT (getdate()), CONSTRAINT [PK_TScuEMailMember] PRIMARY KEY CLUSTERED ( [FEMail] ASC ) ON [PRIMARY] ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO