tags:

views:

1573

answers:

2

Hi All,

I have a database and have a sql script to add some fields in a table called "Products" of the database.

But when i am executing this script , I am getting the following error:

Cannot find the object "Products" because it does not exist or you do not have permissions

Why it's error occured and what should I do to resolve it?

+2  A: 

Are you sure that you are executing the script against the correct database? In SQL Server Management studio you can change the database you are running the query against in a drop-down box on one of the toolbars, or you can start your query with this:

USE SomeDatabase
Kragen
Thank you very much kragen2uk, I added the statement Use MyDatabase,and it's working now. Thank you .
Praveen
+1  A: 

Does the user you're executing this script under even see that table??

select top 1 * from products

Do you get any output for this??

If yes: does this user have the permission to modify the table, i.e. execute DDL scripts like ALTER TABLE etc.? Typically, regular users don't have this elevated permissions...

Marc

marc_s