if not exists (select * from sys.sysobjects where id = object_id(N'dbo.PamFolder'))
begin
    create table dbo.PamFolder(
        ID uniqueidentifier NOT NULL,
        FolderID uniqueidentifier NULL,
        Security nvarchar(max) NULL,
        Name nvarchar(512) NULL,
        constraint PK_PamFolder primary key clustered (ID)
    );
end;