IF (SELECT COUNT (*)
    FROM INFORMATION_SCHEMA.COLUMNS WITH (NOLOCK) JOIN SYSCOLUMNS WITH (NOLOCK) ON 
	  object_id(INFORMATION_SCHEMA.COLUMNS.table_name) = SYSCOLUMNS.id JOIN 
	    SYSOBJECTS WITH (NOLOCK) ON SYSOBJECTS.id = SYSCOLUMNS.cdefault
             AND COLUMN_DEFAULT IS NOT NULL AND INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = SYSCOLUMNS.NAME
             AND INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'ReservationMain' 
             AND INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = 'AutoConfirmed'
			 AND INFORMATION_SCHEMA.COLUMNS.DATA_TYPE = 'BIT') = 1 
--Safety code to secure...

BEGIN

  DECLARE @defaultconstraint SYSNAME
  DECLARE @dropStmt NVARCHAR(500)

  SELECT @defaultconstraint = SYSOBJECTS.NAME
  FROM INFORMATION_SCHEMA.COLUMNS WITH (NOLOCK) JOIN SYSCOLUMNS WITH (NOLOCK) ON object_id(INFORMATION_SCHEMA.COLUMNS.table_name) = SYSCOLUMNS.id
    JOIN SYSOBJECTS WITH (NOLOCK) ON SYSOBJECTS.id = SYSCOLUMNS.cdefault
           AND COLUMN_DEFAULT IS NOT NULL AND INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = SYSCOLUMNS.NAME
           AND INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = 'ReservationMain' 
           AND INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = 'AutoConfirmed'
		   AND INFORMATION_SCHEMA.COLUMNS.DATA_TYPE = 'BIT'

  SET @dropStmt = 'ALTER TABLE RESERVATIONMAIN DROP CONSTRAINT ' + @defaultconstraint
  EXEC (@dropStmt)

  --Print ('Ready')

  ALTER TABLE ReservationMain ALTER COLUMN AutoConfirmed TINYINT NOT NULL 
  ALTER TABLE ReservationMain ADD CONSTRAINT DF_ReservationMain_AutoConfirmed DEFAULT 0 FOR AutoConfirmed

  --Print ('Done')
END