if not exists (select * from sys.sysobjects where id = object_id(N'dbo.PamLog'))
begin
    create table dbo.PamLog(
        ID uniqueidentifier NOT NULL,
        UserID uniqueidentifier NULL,
        Username nvarchar(256) NOT NULL,
        CredentialID uniqueidentifier NULL,
        FolderID uniqueidentifier NULL,
        CheckoutID uniqueidentifier NULL,
        ResetPasswordScheduleID uniqueidentifier NULL,
        TagID uniqueidentifier NULL,
        DateTime DateTime NOT NULL,
        MessageType int NOT NULL,
        Message nvarchar(max) NULL,
        constraint PK_PamLog primary key clustered (ID)
    );
end;