17 lines
471 B
SQL
17 lines
471 B
SQL
if not exists (select top 1 1 from sys.objects where name = 'UserStatus' and type = 'U')
|
|
begin
|
|
create table UserStatus
|
|
(
|
|
StatusId int identity(1, 1) constraint PK_UserStatus primary key,
|
|
StatusCode varchar(30) not null,
|
|
StatusName varchar(50) not null
|
|
)
|
|
end
|
|
|
|
if not exists (select top 1 1 from UserStatus)
|
|
begin
|
|
insert into UserStatus(StatusCode, StatusName)
|
|
select 'ACTIVE', 'Active' union
|
|
select 'INACTIVE', 'Inactive' union
|
|
select 'BLOCKED', 'Blocked'
|
|
end |