IF NOT EXISTS
(
  SELECT SysColumns.Name 
  FROM SysObjects WITH (NOLOCK) 
    INNER JOIN SysColumns WITH (NOLOCK) ON SysColumns.Id = SysObjects.ID 
    AND SysColumns.Name = 'Id'
    WHERE SysObjects.Name = 'TransactionDeleteNote'
)
  ALTER TABLE dbo.TransactionDeleteNote
  ADD Id INT IDENTITY(1,1)
GO
IF NOT EXISTS
(
  SELECT *
  FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS
  WHERE CONSTRAINT_TYPE = 'PRIMARY KEY'
  AND TABLE_NAME = 'TransactionDeleteNote'
  AND TABLE_SCHEMA ='dbo'
)
  ALTER TABLE dbo.TransactionDeleteNote ADD CONSTRAINT PK_TransactionDeleteNote
  PRIMARY KEY CLUSTERED (Id);