0
votes

This is my first time working on a database project, and I'm using Visual Studio 2013.

I simply followed the instruction on Microsoft to create a database project as listed below:

  1. Create a new database project
  2. Clicked Import --> Database and successfully imported tables
  3. Clicked Add --> Stored Procedure...

However I keep getting this Invalid object name 'TABLENAME'. message for any tables I've imported.

I've tried Use DATABASE_NAME; but it did not help.

Also I've read about refreshing IntelliSense but I do not get the refresh option in VS2013. Plus, it's not just the IntelliSense because I still get the same error when I manually type in the table name.

Even if I create a stored procedure directly in SSMS and then try to run it, I still get the same Invalid object name error.

Any help is appreciated very much.

1

1 Answers

0
votes

The problem was that I didn't change the connection setup to use the correct database server (I was using the local one).

  1. Right click the database project --> Properties
  2. Click Debug
  3. Under Target Connection String, click Edit and select the correct database server
  4. Create a new stored procedure (I've tried up to STEP3 but my problem was that I was not testing on a new stored procedure after changing the connection setup)