1. Enter the Enterprise Manager of Microsoft SQL Server.
2. Select the database for which you want to restore Data, right-click the database, and select all tasks from the context menu to restore the database.
3. Select recover database from the device on the general page.
4. Select the database device to be restored, that is, the *. DUP file, and click OK.
5. Before restoring data, modify the physical file name on the option page to the actual physical file name of the database, and select force restore on the existing database.
6. Modify the objects owner and the database user ID.
Log on to the query Analyzer of Microsoft SQL Server using the SA and execute the following SQL statement:
(1) modify system parameters
Sp_configure "allow updates", 1
Go
Reconfigure with override
Go
(2) modify the objects owner (assume that the backup data of the 001 ledger is restored to the 002 ledger)
Update cwbase2.. sysusers set name = 'lc0029999'
Where cwbase2... sysusers. Name = 'lc001129'
Go
Update cwbase2.. sysusers set name = 'ad0029999'
Where cwbase2... sysusers. Name = 'ad00%9'
Go
Commit
(3) modify the Database User ID:
Update cwbase * .. sysusers set SID = Master .. syslogins. Sid
From cwbase *... sysusers, Master... syslogins
Where cwbase *... sysusers. Name = Master... syslogins. Name
Go
Commit
(4) restore system parameter settings
Sp_configure "allow updates", 0
Go
Reconfigure with override
Go
Finally, go to the maintenance tool, delete all users, register new users, and assign function and data permissions.