Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
groth.j
Starting Member
6 Posts |
Posted - 2008-02-06 : 15:37:51
|
I work for a Geographic Information Systems contractor and we are new to SQL 2005. One of our clients sent us a copy of an .mdf file. I have tried to attach the file but they did not send us the associated log file. What is the most efficient way for us to exchange copies of SQL 2005 databases with clients. Most of our clients are novices with SQL 2005 also.Thanks,Jeff |
|
Qualis
Posting Yak Master
145 Posts |
Posted - 2008-02-06 : 16:32:10
|
Do you want the whole database or just tables? One good way is to do a backup to a file and then you can take that file and restore it to any server. One problem that you might run into is that of database users. If you are using Windows Authentication it may not be an issue. I don't know how cross domain accounts will react, however. If you are using SQL Server authentication, you will have to sync the users. The following script should be sufficient for this purpose:Declare @Users_stmt varchar(75)Declare Users_Cursor Cursor For Select 'sp_change_users_login ''auto_fix'', ''' + [Name] + ''''From sysusers Where (Status = 2 Or Status = 14) And UID <> 1Open Users_CursorFetch Next From Users_Cursor Into @Users_stmtWhile @@FETCH_STATUS = 0 Begin Exec (@Users_stmt) Fetch Next From Users_Cursor Into @Users_stmtEndClose Users_CursorDeallocate Users_CursorRun this on the newly restored database. |
 |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-02-07 : 00:22:25
|
Tried attach it with sp_attach_single_file_db? |
 |
|
|
|
|