if not exists (select * from sys.sysobjects where id = object_id(N'dbo.PamCredentialTag'))
begin
    create table dbo.PamCredentialTag(
        CredentialID uniqueidentifier NOT NULL constraint FK_PamCredentialTag_CredentialID foreign key references dbo.PamCredential(ID),
        TagID uniqueidentifier NOT NULL constraint FK_PamCredentialTag_TagID foreign key references dbo.PamTag(ID),
        constraint PK_PamCredentialTag primary key clustered (CredentialID, TagID)
    );
end;