或者: 图2. Drop查询执行的错误 错误是:The database principal owns a schema in the database, and cannot be dropped. 大意是:该数据库主体拥有数据库架构(Schema),不能被删除。 解决方案两种,一种用查询代码的方法,一种用SSMS图形界面的方法: 用查询代码的办法 查询到特定用户拥有的Schema: --达叔傻乐 ...
Description of the problem:When you tried to drop a user, you got this message: Error: 15138 The database principal owns a schema in the database, and cannot be dropped. Cause:That means, you are trying to drop a user owning a schema. In order to drop the user, you have to find ...
DROPUSERtony; SQL Server报如下错误: The database principal owns a schemainthe database,andcannot be dropped. 因为tony拥有架构report,所以DROP USER无法删除他 要删除用户tony,需要先将架构report的授权转移给另一个用户。例如,以下语句将架构report的授权更改为用户dbo: ALTERAUTHORIZATION ONSCHEMA::report TOd...
就说明这个用户有connect到这个数据库的权限,不等于use dbname;grant connect to username,因为图形界面登录名在某个数据库勾选了public,此时schema是dbo,而grant connect to username语句执行后,此时SSMS图形界面可以看到schema是username,之后不能在图形界面取消这个登录名在这个数据库的public权限,会报错the...
Users that own securables cannot be dropped from the database. Before dropping a database user that owns securables, you must first drop or transfer ownership of those securables. The guest user cannot be dropped, but guest user can be disabled by revoking its CONNECT permission by executing...
Thedbouser owns thedboschema. Thedboschema is the default schema for all users, unless some other schema is specified. Thedboschema cannot be dropped. public Server Role and Database Role Every login belongs to thepublicfixed server role, and every database user belongs to thepublic...
t1(c1) TO testUser; GO EXECUTE AS USER='testUser'; SELECT OBJECT_SCHEMA_NAME(object_id), OBJECT_NAME(object_id), name FROM sys.columns; SELECT * FROM sys.tables -- this returns metadata for all columns of the table and the table itself REVERT; GO DROP TABLE t1 DROP USER testUser ...
SETUSER 'TestLogin1'; GO SELECT xmlCol.query('declare default element namespace "https://schemas.adventure-works.com/Additional/ContactInfo"; /telephone[1]') FROM MyTestTable; GO -- Final cleanup SETUSER; GO USE master; GO DROP DATABASE SampleDBForSchemaPermissions; GO DROP LOGIN TestLo...
Cannot obtain the required interface ("IID_IDBSchemaRowset") from OLE DB provider "OraOLEDB.Oracle" for linked Cannot open backup device 'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\Backup\path'. Operating system error 2(The system cannot find the file specified.). Cannot...
14255 16 No The owner ('%s') of this job is either an invalid login, or is not a valid user of database '%s'. 14256 16 No Cannot start the job "%s" (ID %s) because it does not have any job server or servers defined. Associate the job with a job serv...