/*

       MSSQL 2005 script to create tables from MS-Access

       generated Friday, March 20, 2009 at 11:23 PM

*/

IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Client]') AND type in (N'U'))

DROP TABLE [dbo].[Client]

GO

 

CREATE TABLE dbo.[Client]

       (

       [ClientID] int IDENTITY(1,1)  NOT NULL,

       [Client] nvarchar(25) NOT NULL,

       [FormalName] nvarchar(80) NULL,

       [Address1] nvarchar(80) NULL,

       [Address2] nvarchar(80) NULL,

       [City] nvarchar(50) NULL,

       [US_State] nvarchar(2) NULL CONSTRAINT [DF_Client_US_State] DEFAULT ('AZ'),

       [Contact] nvarchar(50) NULL,

       [Phone] nvarchar(50) NULL,

       [Fax] nvarchar(50) NULL,

       [Inactive] bit NULL CONSTRAINT [DF_Client_Inactive] DEFAULT (0),

       [Date_Added] datetime NULL CONSTRAINT [DF_Client_Date_Added] DEFAULT ( GETDATE() ),

       [User_Added] nvarchar(50) NULL CONSTRAINT [DF_Client_User_Added] DEFAULT (SUSER_SNAME()),

       [Comments] nvarchar(4000) NULL

PRIMARY KEY CLUSTERED

       (

       [ClientID] ASC

       )

       WITH (

              PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF, FILLFACTOR = 90

              ) ON [PRIMARY]

       ) ON [PRIMARY]

GO

 

CREATE UNIQUE NONCLUSTERED INDEX IX_Client_Client ON dbo.[Client]

       (

       Client ASC

       )

       WITH (

              STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON

              ) ON [PRIMARY]

GO

CREATE NONCLUSTERED INDEX IX_Client_US_State ON dbo.[Client]

       (

       US_State ASC

       )

       WITH (

              STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON

              ) ON [PRIMARY]

GO