Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSIS Error: Invalid object name - but object exists and query runs in SSMS

Tags:

I'm currently updating all of our ETLs using Visual Studio 2015 (made in BIDS 2008) and redeploying them to a new reporting server running on SQL Server 2016 (originally 2008R2).

While updating one of the ETLs I got this error:


Exception from HRESULT: 0xC0202009 Error at Load Staging Table [OLE DB Source [129]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Invalid object name 'dbo.TimeSheets'.".


Here's what I've tried:

  • Checked my connection strings to make sure they were correct.
  • Checked the schema to make sure it existed and was correct.
  • Ran query from SSMS and it worked.
  • Ctrl + Shift + R to refresh intellisense.
  • Checked to see if another table exists with the same name.
  • Restarted Visual Studio and SSMS.
like image 769
Jonathan Porter Avatar asked Dec 29 '16 21:12

Jonathan Porter


1 Answers

I got a successful fix from the comments of the question "The other option would be to fully qualify the table name {database}.{schema}.{table} to ensure that, regardless of the default catalog, you query the correct database."

I was using some other database and it was caching and using that DB name rather than the new one I changed to.

like image 193
aman Avatar answered Sep 22 '22 10:09

aman