您可以使用T-SQL:use masterGOCREATE LOGIN [NT AUTHORITY\LOCALSERVICE] FROM WINDOWS WITHDEFAULT_DATABASE=yourDbNameGOCREATE LOGIN [NT AUTHORITY\NETWORKSERVICE] FROM WINDOWS WITHDEFAULT_DATABASE=yourDbName我将其用作从生产服务器还原到测试机的一部分:USE masterGOALTER DATABASE yourDbName SET OFFLINE WITH ROLLBACK IMMEDIATERESTORE DATABASE yourDbName FROM DISK = 'd:\DropBox\backup\myDB.bak'ALTER DATABASE yourDbName SET ONLINEGOCREATE LOGIN [NT AUTHORITY\LOCALSERVICE] FROM WINDOWS WITHDEFAULT_DATABASE=yourDbNameGOCREATE LOGIN [NT AUTHORITY\NETWORKSERVICE] FROM WINDOWS WITHDEFAULT_DATABASE=yourDbNameGO如果是德语或法语Windows,则需要使用服务的本地化名称