标签: sql-server sql-server-2008 tsql
如何检查SQL Server实例中是否已存在凭据,以避免在运行DROP CREDENTIAL时出错?
DROP CREDENTIAL
通常我使用SSMS中的SCRIPT AS ...和DROP And CREATE To功能来创建脚本,但CREDENTIAL没有该选项
SCRIPT AS ...
DROP And CREATE To
CREDENTIAL
答案 0 :(得分:8)
if exists (select * from sys.credentials where name = 'CredName') drop credential CredName