Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL server does not give compilation error for invalid table name

Status
Not open for further replies.

desi2002

Programmer
Jan 4, 2002
24
IN
Hi
I deleted tables that I used while creating and compiling one stored procedure. After deleting the tables, I edited the stored procedure without changing the table names. SQL server should give me syntax error because the tables mentioned in the stored procedure do not exist. However it says “syntax check successful”. I then altered that stored procedure through SQL query analyzer again without changing the table names. Here also it did not give me compilation error. Off course it displays run time error while executing. Does anybody know why SQL server behaves like this? Do I need to install anything?

Thanks
Smita

 
The reason it behaves like this is that sql doesnt' assume that you already built all the tables you specifed at complie time (as you don't compile so much as save the definition), it waits till runtime to check if the object exists.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top