Home > Microsoft SQL Server > Urgent! Please help. Can't insert!

Urgent! Please help. Can't insert!



Hi,



I am running SQL2000 on W2k server. Everything was working fine untill sometime yesterday. All in a sudden, I was not able to insert into my database table. I can do select, and I can even run sp_columns on the table, but when I try to INSERT, I get the following error ...





Server: Msg 208, Level 16, State 3, Line 4

Invalid object name [tablename].



The insert statment should be working fine as they were run before the problem occurs! Has anyone ran into this before? Any input is appreciated!



Thanks!



Kevin

    
Guest


btw, I was using SQL Analyzer!

Was this answer helpful ? Yes No   
Guest


you may be using query analyzer but someone else may have been using Enterprise manager in which case it's quite easy to alter the schema by accident. Double check the names of the columns to make sure they haven't been altered



also you mention stored procedures. If your stored procedure is selecting data from a table in a different DB you might also get this method with disconnected recordsets. In which case the remote portion of ActiveX Data Objects (ADO) (Msdaprst.dll) is inadvertently overwriting portions of the metadata contained in the recordset. When subsequently constructing the UPDATE statement, this metadata is not available and incorrect syntax is generated.



If you examine the trace logs, you'll see that the correct database.owner.tablename syntax was used while selecting the records, but only the tablename was used while constructing the UPDATE statement.



Because the Connection currently points to the database containing the stored procedure and the table does not exist in that database, "Invalid object name" errors will be returned.



Regards

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved