15 lines
1.3 KiB
Transact-SQL
15 lines
1.3 KiB
Transact-SQL
/*
|
||
Run this script on SQL Server 2008 or later. There may be flaws if running on earlier versions of SQL Server.
|
||
*/
|
||
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Security]') AND type in (N'U'))
|
||
DROP TABLE [dbo].[Security]
|
||
GO
|
||
CREATE TABLE [dbo].[Security] (
|
||
[PrincipalId] [uniqueidentifier] NOT NULL,
|
||
[Read] [int] NOT NULL CONSTRAINT [DF_Security_Read] DEFAULT ((0)),
|
||
[Write] [int] NOT NULL CONSTRAINT [DF_Security_Write] DEFAULT ((0)),
|
||
[SecurityObject] [nvarchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
|
||
CONSTRAINT [PK_Security] PRIMARY KEY CLUSTERED ([PrincipalId], [SecurityObject])
|
||
) ON [PRIMARY]
|
||
GO
|