I have a database and have a Sql script to add some fields to a table called "Products" in 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 is the error occurring and what should I do to resolve it?
This can be done from SQL Management Studio or directly by SQL query: - Right click on the specific stored procedure, select Properties, go to Permissions page. Search for 'ComXClient' user and then select checkbox in Execute line and Grant column.
The REFERENCES permission on a table is needed to create a FOREIGN KEY constraint that references that table. The REFERENCES permission is needed on an object to create a FUNCTION or VIEW with the WITH SCHEMABINDING clause that references that object.
Permissions. The minimum permission required is ALTER on table_name. TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable.
I found a reason why this would happen. The user had the appropriate permissions, but the stored procedure included a TRUNCATE
statement:
TRUNCATE TableName
Since TRUNCATE
deletes items without logging, you (apparently) need elevated permissions to execute a stored procedure that contains it. We changed the statement to:
DELETE FROM TableName
...and the error went away!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With