USE [Account_CN]
GO
ALTER TABLE [dbo].[tUser] DROP CONSTRAINT [FK_tUser_tUserAuth_nAuthID]
GO
/****** Object: Table [dbo].[tUser] Script Date: 20/09/2015 9:54:47 PM ******/
DROP TABLE [dbo].[tUser]
GO
/****** Object: Table [dbo].[tUser] Script Date: 20/09/2015 9:54:47 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tUser](
[nUserNo] [int] IDENTITY(1,1) NOT NULL,
[sUserID] [nvarchar](30) NOT NULL,
[sUserPW] [nvarchar](20) NOT NULL,
[sUserName] [nvarchar](10) NOT NULL,
[bIsBlock] [bit] NOT NULL CONSTRAINT [DF__tUser__bIsBlock__014935CB] DEFAULT ((0)),
[bIsDelete] [bit] NOT NULL CONSTRAINT [DF__tUser__bIsDelete__023D5A04] DEFAULT ((0)),
[nAuthID] [tinyint] NOT NULL CONSTRAINT [DF__tUser__nAuthID__03317E3D] DEFAULT ((1)),
[sUserIP] [nvarchar](30) NOT NULL,
[sEmail] [nvarchar](90) NULL,
[nAge] [tinyint] NULL,
[dDate] [datetime] NOT NULL CONSTRAINT [DF__tUser__dDate__0425A276] DEFAULT (getdate()),
CONSTRAINT [PK_tUser_CL] PRIMARY KEY CLUSTERED
(
[nUserNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tUser] WITH CHECK ADD CONSTRAINT [FK_tUser_tUserAuth_nAuthID] FOREIGN KEY([nAuthID])
REFERENCES [dbo].[tUserAuth] ([nAuthID])
GO
ALTER TABLE [dbo].[tUser] CHECK CONSTRAINT [FK_tUser_tUserAuth_nAuthID]
GO