Use ATNDBTest
Go

If Exists(Select * From INFORMATION_SCHEMA.TABLES Where TABLE_NAME = 'RolePerUser' AND TABLE_SCHEMA = 'dbo') Drop Table dbo.RolePerUser
Create Table dbo.RolePerUser(
	Serial Bigint Identity(1,1) Not Null,
	UserRef Int Not Null,
	RoleRef Bigint Not Null)
GO
Alter Table dbo.RolePerUser Add Constraint PK_RolePerUser Primary Key Clustered (Serial)
GO
/*=============================================================================================================*/
If Exists(Select * From INFORMATION_SCHEMA.TABLES Where TABLE_NAME = 'Roles' AND TABLE_SCHEMA = 'dbo') Drop Table dbo.Roles
Create Table dbo.Roles(
	Serial Bigint Identity(1,1) Not Null,
	Code Int Not Null,
	FADescription Varchar(50) Null,
	ENDescription Varchar(50) Null,
	Permition Varchar(max) Null,
	RecorderRef Int Null,
	RecordDate Char(10) Null,
	EditorRef Int Null,
	EditDate Char(10) Null,
	Comment Varchar(300) Null,
	OfficeDetailRef Int Null)
GO
Alter Table dbo.Roles Add Constraint PK_Roles Primary Key Clustered (Serial)
GO
/*=============================================================================================================*/
