I had the same problem and finally managed to solve it using SET NOEXEC.
IF not whatever
BEGIN
SET NOEXEC ON;
END
ALTER TABLE dbo.EMPLOYEE ADD COLUMN EMP_IS_ADMIN BIT NOT NULL
GO
UPDATE dbo.EMPLOYEE SET EMP_IS_ADMIN = whatever
SET NOEXEC OFF;
More Related Contents:
- I dont know sql syntax for my table [closed]
- Is it possible to write single query on two table which are not connected to each other?
- CROSS JOIN vs INNER JOIN in SQL
- Can I Comma Delimit Multiple Rows Into One Column? [duplicate]
- Multiple INSERT statements vs. single INSERT with multiple VALUES
- Split function equivalent in T-SQL?
- Is the NOLOCK (Sql Server hint) bad practice?
- Is having an ‘OR’ in an INNER JOIN condition a bad idea?
- Where value in column containing comma delimited values
- Parse comma-separated string to make IN List of strings in the Where clause
- How to update Identity Column in SQL Server?
- SQL query to split column data into rows
- Common Table Expression, why semicolon?
- T-SQL split string based on delimiter
- Bulk DELETE on SQL Server 2008 (Is there anything like Bulk Copy (bcp) for delete data?)
- Splitting delimited values in a SQL column into multiple rows
- Compare DATETIME and DATE ignoring time portion
- Split function in SQL Server 2008
- SQL “between” not inclusive
- Can I set ignore_dup_key on for a primary key?
- Using PIVOT in SQL Server 2008
- Stored procedure that exports data into csv files only exports to one file
- How do I prevent a database trigger from recursing?
- How can I group by date time column without taking time into consideration
- How to combine results of two queries into a single dataset
- When using GETDATE() in many places, is it better to use a variable?
- Executing SQL Server Agent Job from a stored procedure and returning job result
- SQL take just the numeric values from a varchar
- COALESCE Function in TSQL
- Using CASE Statement inside IN Clause