這個情形會發生在不同伺服器將資料庫A移到資料庫B, 資料庫A 的使用者名稱並不會自動移到資料庫B,這時候可以利用微軟網頁提供的二個預儲程序sp_hexadecimal 和 sp_help_revlogin,再資料庫A執行EXEC sp_help_revlogin,會產生建使用者名稱及密碼的語法,再將此語法複製到資料庫B執行就完成。
參考資料: https://support.microsoft.com/zh-tw/help/918992/how-to-transfer-logins-and-passwords-between-instances-of-sql-server
如何在 SQL Server 的執行個體之間傳送登入和密碼
語法: http://bestdaylong.com/n/mssql_createuser/