IF NOT EXISTS
(
    SELECT COLUMN_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'TblQueue'
          AND COLUMN_NAME = 'LineNo'
)
    ALTER TABLE dbo.TblQueue ADD [LineNo] TINYINT NULL DEFAULT (0);




IF EXISTS
(
    SELECT *
    FROM dbo.sysobjects
    WHERE id = OBJECT_ID(N'[dbo].[Sp_Queue]')
          AND OBJECTPROPERTY(id, N'IsProcedure') = 1
)
    DROP PROCEDURE [dbo].[Sp_Queue];