I am using the following script to add a column to my table. When I hit F5 in the query window it gives an error on the 2nd update query that fkRefTabNo doesn't exist.
ALTER TABLE EPFieldSQLScripts
ADD fkRefTabNo int DEFAULT 1
update EPFieldSQLScripts
set fkRefTabNo = 1
where fkRefTabNo is null
ALTER TABLE EPFieldSQLScripts
ALTER COLUMN fkRefTabNo INTEGER NOT NULL
But when I run these queries one by one, it doesn't give an error. Can anyone tell me what is wrong with this script?