Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot drop the view 'XXX' because it does not exist or you do not have permission

We migrated our servers from 2005 to 2014, User is able to delete it in the 2005 server But in 2014 we are getting the error as do not have permission or does not exits We have given to same permissions and even he is a system admin.In our application side they are not able to drop the view the application users are connecting through a user in our database he has all the permissions and he is sysyadmin

like image 397
surya teja Avatar asked Apr 07 '16 16:04

surya teja


People also ask

How do I give permission for a view?

1 Answer. For views to be created in the future, you cannot grant user any permission while creating them. You can choose to grant permissions after creating views. Or create a new schema for these views, and grant these users the right to select objects in this schema .

How do I give permission to drop a table in SQL Server?

DROP TABLE requires ALTER permission on the schema to which the table belongs, CONTROL permission on the table, or membership in the db_ddladmin fixed database role. CREATE TABLE requires CREATE TABLE permission in the database and ALTER permission on the schema in which the table is being created.

Could not drop object because it is referenced by a foreign key constraint?

In SQL Server, you cannot drop a table if it is referenced by a FOREIGN KEY constraint. You have to either drop the child tables before removing the parent table, or remove foreign key constraints.

Can not execute as the database principal?

Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission. It is very simple to fix the error. It happens because of the database owner is blank in the database properties for the file.


1 Answers

This problem can be simply solved if its simply happening, follow the steps:

  1. See which database you are working in, e.g I am working in the database student_fast.
  2. After getting the database name you are working in, write a query (use database_name) and execute it.
  3. Now try drop command.
  4. It works as per my problem.
like image 160
M Anas Avatar answered Sep 30 '22 15:09

M Anas