Search code examples
sqlsql-server-2005

How to solve 'invalid object name' in SQL Server?


This is the error message returned:

Msg 208, Level 16, State 1, Line 1 Invalid object name 'ENG_PREP'.

It happens after I try the following query:

insert into ENG_PREP VALUES('572012-01-1,572012-01-2,572012-01-3,572013-01-1,572013-01-2',
'',
'500',
'',
'A320 P.001-A',
'Removal of the LH Wing Safety Rope',
'',
'',
'',
'0',
'',
'AF',
'12-00-00-081-001',
'',
'',
'',
'',
'',
'',
'' )

Solution

  • It doesn't necessarily mean that it can't find "ENG_PREP" in your SQL insert query itself. Check any triggers that run on that table as well and make sure all of them have the exact table name spelled correctly.

    This JUST happened to me when debugging a stored procedure and it took me half an hour to find it.