How to import Login from a SQL Server 2000 instance to another instance

xiaoxiao2021-03-06  70

1. Use T-SQL you can run the following script first on the Source SQL Server, which generates the T-SQL statement that can be executed; then you can perform these generated T-SQL statements on the destination server: Set nocount on

SELECT 'EXEC SP_ADDLOGIN @loginame =' '' loginname '' ',', @DEFDB = '' ' dbname ' '' ', @deflanguage =' '' language '' ', ', @encryptopt =' 'Skip_encryption' ',', @passwd = ', Cast (Password As Varbinary (256)),', @SID = ', Sidfrom Sysloginswhere Name Not in (' SA ') and isntname = 0

SELECT 'EXEC sp_grantlogin @loginame =' '' loginname '' '', 'EXEC sp_defaultdb @loginame =' '' loginname '' '', ', @defdb =' '' dbname '' '' From syslogins where loginname not in ('Builtin / Administrat "and isntname = 1 2. In addition, you can also use the Transfer logins task of SQL Server 2000 DTS.

转载请注明原文地址:https://www.9cbs.com/read-109371.html

New Post(0)