Is it possible to create or alter a stored procedure in SQL Server 2005* that doesn't compile the procedure?
(* - yes, unfortunately, we still need to support 2005 as our minimum standard)
I have a situation where it would be exceedingly useful to be able to create/alter a stored procedure that is syntactically valid but not semantically valid (due to incorrect table/column names)... which I can then alter accordingly within SSMS.
I've just had a thought, and it's a pretty simple solution... comment out the entire contents of the stored procedure when it's being altered/created.
Using Ctrl+K Ctrl+C will comment out each line individually - which would be better than using
/* */ around the entire thing, as that will fail if there are any instances of
/* */ in the stored procedure already.
I would still be very interested to hear if there is an actual way to tell SSMS to ignore invalid table/view/column names.
Thanks to @marcelo for his answer, and it does appear that using the name of a non-existent table will allow you to create the stored procedure.
However, it does not allow you to create a stored procedure if you use a non-existent column in an existing table