-
Urgent!! - Detaching & Attaching db files
Hi!
I am trying to detach & attach db files onto another server (sql 7.0).
I am using this to detach the db:
Exec sp_detach_db 'dbname', 'false'
GO
Then I am copying files over to the destination server & running:
EXEC sp_attach_db @dbname = 'dbname',
@filename1 = 'z:\mssql7\data\dbname_data.mdf',
@filename2 = 'z:\mssql7\data\dbnamer_log.ldf'
GO
Then I am running :
sp_change_users_login 'auto_fix', 'dbADM'
go
sp_change_users_login 'auto_fix', 'dbUSER'
go
Everythg looks okay, except that there are 2 users created that do not have any login associated to them. & the weird thing is that the tables are all owned by 1 of these 2 logins. The original logins are also there on the destination db.
Now, I can't drop & recreate these users, as tables are owned by them...what do I do ? Why are these users not created correctly even though the logins are there on the db?
Please helppppp!!!!!!!!!
-
You can change table owner with sp_changeobjectowner, then drop user.
-
Hmm, I will try that...
Thanks!
-
You can also try:
sp_change_users_login 'Update_One', 'login','user'
go
-
That worked Pan!
I had tried sp_change_users_login, but with the autofix option...duh! but thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|