sqlServer 用户

Last updated on November 22, 2024 pm

🧙 Questions

☄️ Ideas

创建用户

在控制台执行sql命令的时候 需要另起一行敲代码 go
– DROP USER ispong;

-- 创建登录用户

CREATE LOGIN test_user WITH PASSWORD = 'test123...';
CREATE USER test FROM LOGIN test_user  

-- 创建数据库
CREATE DATABASE test_db COLLATE Chinese_PRC_CI_AS;

-- 创建数据库用户
-- CREATE USER test_db_admin FROM LOGIN test_user;

-- DROP DATABASE ispong_db;
-- 给用户赋权数据库
-- GRANT CREATE SCHEMA,CONNECT,CREATE TABLE ON DATABASE::test_db TO test_db_admin;
use test_db;
GRANT ALL ON DATABASE::test_db TO test_user;
-- GRANT SELECT,ALTER ,INSERT ON SCHEMA::dbo TO ispong_admin;  

查询sqlServer版本

SELECT @@version

sqlServer 用户
https://ispong.isxcode.com/db/sqlserver/sqlServer 用户/
Author
ispong
Posted on
July 6, 2021
Licensed under