更改数据库的排序规则,SQL提示 5030 的错误,错误信息如下: The database could not be exclusively locked to perform the operation. 解决方法: 1.设置数据库的 Ristrict Access 为 SINGLE_USER. 2.执行下列语句更改排序规则 USE master GO ALTER DATABASE 'your db name' COLLATE Chinese_PRC_CI_AS GO 3.上述命令执行成功之
--系统表里存放各个数据库属性信息的表之一SELECT name AS [Logical Name], physical_name AS [DB File Path],type_desc AS [File Type],state_desc AS [State] FROM sys.master_files WHERE database_id = DB_ID(N'cardTest20160106') --修改数据库名--alter DATABASE cardTest20160106 modify n
最近项目向MySql迁移,迁移完毕后,在获取用户权限时产生了一个异常,跟踪进去获取执行的语句如下, SELECT PermissionId FROM spysxtPermission WHERE (ResourceCategory = 'BaseUser' ) UNION SELECT PermissionId FROM spysxtPermission , ( SELECT RoleId FROM spysxtUserRole ) UNION SELECT RoleId ) ) B WHERE
--查看当前的存放位置 select database_id,name,physical_name AS CurrentLocation,state_desc,size from sys.master_files where database_id=db_id(N'数据库名'); --修改文件的存放位置下次启动生效 --testDb为数据库名, alter database 数据库名 modify file ( name = 文件名(不包含后缀), filename = '文件存储路径'
use master -- 设置当前数据库为master,以便访问sysdatabases表 go if exists(select * from sysdatabases where name='testDB') drop database testDB go create database testDB ALTER DATABASE test COLLATE Chinese_PRC_CI_AS