您好,登錄后才能下訂單哦!
SELECT 'EXEC master..sp_addsrvrolemember @loginame = N'''+loginname+''', @rolename = N'''+priv+''''
FROM
(
SELECT loginname, priv, value
FROM
(
SELECT loginname, sysadmin, securityadmin, serveradmin, setupadmin, processadmin, diskadmin, dbcreator, bulkadmin
FROM sys.syslogins
) AS a UNPIVOT(value FOR priv IN(sysadmin, securityadmin, serveradmin, setupadmin, processadmin, diskadmin, dbcreator, bulkadmin)) AS UPV
) AS T
WHERE VALUE = 1;
![](https://cache.yisu.com/upload/information/20200311/41/171158.jpg?x-oss-process=image/watermark,size_16,text_QDUxQ1RP5Y2a5a6i,color_FFFFFF,t_100,g_se,x_10,y_10,shadow_90,type_ZmFuZ3poZW5naGVpdGk=)
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。