EnVisageOnline/Main/Database/Scripts/20150317/01_create_templategroups.sql

18 lines
552 B
Transact-SQL

USE [EnVisage]
GO
IF not EXISTS (SELECT * FROM sys.tables where name like 'TemplateGroup')
begin
begin tran
CREATE TABLE [dbo].[TemplateGroup](
[Id] [uniqueidentifier] NOT NULL,
[Name] [nvarchar](256) NOT NULL,
CONSTRAINT [PK_TemplateGroup] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
ALTER TABLE [dbo].[TemplateGroup] ADD CONSTRAINT [DF_TemplateGroup_Id] DEFAULT (newid()) FOR [Id]
commit tran
end