我正在尋找最好的方式來檢查數據庫的登錄在SQL Server中存在的最佳途徑2005年我目前使用什麼是您在SQL Server中的登錄的存在,2005年
IF suser_sid('loginname') IS NOT NULL
但是在某些登錄不存在的情況下,suser_sid()會返回一個值。
在SQL 2000年,我們用
SELECT * FROM [Master].[dbo].[sysxlogins] WHERE [name] ='loginname'
,但該表中不存在SQL 2005
有一個類似的問題有關checking the existence of Users,這是有益的,但我在尋找的存在登錄。