IF NOT EXISTS
(
    SELECT name
    FROM sys.objects
    WHERE name = 'SMS_AutoSendingSettings'
)
    CREATE TABLE [dbo].[SMS_AutoSendingSettings]
    (
        [ServiceId] [TINYINT] NOT NULL,
        [SendType] [TINYINT] NULL,
        [DefinedSmsId] [INT] NULL,
        [SQLCommandText] [NVARCHAR](MAX) NULL,
        [IsActive] [BIT] NULL,
        CONSTRAINT [PK_SMSAutoSendingSettings]
            PRIMARY KEY CLUSTERED ([ServiceId] ASC)
    ) ON [PRIMARY];