代码改变世界

数据库用户名操作

2010-08-25 13:42  Kee Wang  阅读(204)  评论(0)    收藏  举报

 

创建用户名:EXEC sp_addlogin 用户名,'密码,'master'

 

判断用户名是否存在:

if  not exists(select name from syslogins where name='登陆名')
begin
sp_addlogin '登陆名','密码','数据库名'
end