Q:

Alter and update statement executed together

This query has made my day bad.
It works when executed seperately one after other but creates error when the entire query is selected and executed.
ALTER TABLE ProcedureMaster
add TierId smallint null

update ProcedureMaster set TierId=3 where TierId is null

The error is :
Msg 207, Level 16, State 1, Line 4
Invalid column name 'TierId'.

A:

You need to alter like this using GO:
BEGIN TRANSACTION
GO
ALTER TABLE ProcedureMaster
add TierId smallint null
GO
update ProcedureMaster set TierId=3 where TierId is null   
COMMIT TRANSACTION    

