首先创建一个登陆名:
create login login1 with password='stu1',default_database=student
现在要在student 中创建一个用户名 stu1,指定密码为 123456该怎么做?
create user stu1 for login login1 //这是没有指定密码的语句
create login login1 with password='stu1',default_database=student
现在要在student 中创建一个用户名 stu1,指定密码为 123456该怎么做?
create user stu1 for login login1 //这是没有指定密码的语句
exec sp_addlogin '用户名','密码','默认数据库名'
--添加到数据库
exec sp_grantdbaccess '用户名','数据库名'