if not Exists(SELECT * FROM information_schema.tables where Table_name = 'Role') begin create table [Role] ( ID int primary key, Title nvarchar(200), Kar_ID int references Karbar(ID) not null, TarikhSabt int not null, SaatSabt smallint not null ) end go if not Exists(SELECT * FROM information_schema.tables where Table_name = 'RoleItem') begin create table RoleItem ( ID int primary key, Rol_ID int references [Role](ID) not null, AmaliateSystem_ID int references AmaliateSystem(ID) not null, Kar_ID int references Karbar(ID) not null, TarikhSabt int not null, SaatSabt smallint not null ) end go if not Exists(SELECT * FROM information_schema.tables where Table_name = 'UserRole') begin create table UserRole ( ID int primary key, Rol_ID int references [Role](ID) not null, Kar_ID int references Karbar(ID) not null, TarikhSabt int not null, SaatSabt smallint not null ) end