sql-serverstored-procedurestypechecking

Is there a way to have SQL server validate object references in Stored Procs?


The following code executes fine in SQL Server

create proc IamBrokenAndDontKnowIt as
select * from tablewhichdoesnotexist

Of course if I try to run it, it fails with

Invalid object name 'tablewhichdoesnotexist'.

Is there any way to compile or verify that Stored Proc are valid?


Solution

  • I've just discovered that VS2010 with database projects will do syntax and name reference checking. Seems like the best option.