2011年4月25日

2008删除没有数据库用户映射的登录及该登陆对应的作业

摘要: use NorthWind--#temp是有数据库用户映射的登录create table #temp(dbname varchar(100),loginname varchar(100))declare @str varchar(max)declare @dropstr varchar(5000)declare @dropjob varchar(5000)set @dropjob=''set @dropstr=''set @str=''select @str=@str+'select a.name as dbname,b.name as 阅读全文

posted @ 2011-04-25 16:02 anivie 阅读(163) 评论(0) 推荐(0) 编辑

给用户添加执行存储过程权限

摘要: 1.创建给用户添加执行存储过程权限的存储过程createprocedurep_addexec@usernamevarchar(50)asCREATEROLE[execp]AUTHORIZATION[dbo]declare@strRolevarchar(50)declare@strvarchar(5000)set@str=''set@strRole='execp'select@str=@str+'grantexecuteon'+name+'to'+@strRole+';'fromsysobjectswherextyp 阅读全文

posted @ 2011-04-25 14:40 anivie 阅读(1182) 评论(0) 推荐(0) 编辑

导航