2012-06-08 116 views

回答

7
if exists (select * from sys.credentials where name = 'CredName') 
    drop credential CredName 
+0

謝謝...任何想法,爲什麼DROP/CREATE選項不可在SSMS菜單上與其他數據庫文物一樣? – SteveC

+0

它也不存在於SSMS 2012中,並且'Properties - > Script Action As'按鈕不起作用。不知道爲什麼。 – Andomar

+1

SSMS中是否存在特徵通常是SMO中是否存在該特徵的雙映射。但是,在這種情況下,似乎並非如此。具體而言,Microsoft.SqlServer.Management.Smo.Credential類中存在Drop()方法。我只是用一個虛擬證書來測試它,它工作。我在這裏登錄了一個Connect選項:https://connect.microsoft.com/SQLServer/feedback/details/747691/drop-credential-not-available-through-ssms。 –

相關問題