Use @DBNAME

SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
Begin Transaction updateMorTypeApprove

IF Not EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'dbo.MorTypeApprove') AND type in (N'U'))
    CREATE TABLE dbo.MorTypeApprove
    (
        CODE numeric(6, 0) NOT NULL,
        IsApprove bit NOT NULL
    )

If (@@ERROR > 0 )
  Rollback Transaction updateMorTypeApprove
Else
    Commit Transaction updateMorTypeApprove
