2

enter image description here

This happens frequently to me, SQL Server doesn't recognize my tables.

I tried to refresh the database, also tried to refresh the intellisense. But nothing worked!

Could anyone help please?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

2 Answers2

3

You can preface the code with

USE Sales_DB

And it will always start with that database.

Zorkolot
  • 1,899
  • 1
  • 11
  • 8
2

Can you ensure that you are not running this against the "master" database? When setting up a user, if a default database is not specified, when you connect using SSMS it defaults to master.. change the db or use the use[your database] statement before you run any other queries.

Harry
  • 2,636
  • 1
  • 17
  • 29