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 |
pug2694328
Posting Yak Master
166 Posts |
Posted - 2007-01-04 : 17:26:31
|
We have a third party that sends us a cd containing one MDF and one NDF file.I'd like to 'restore' these to our server as a database. I don't have the LDF file and will never get it. I'm not sure that I need the NDF file.Per this string: http://forums.belution.com/en/sql/000/017/79s.shtmlI should be able to create a db on my server with a duplicate nameCREATE DATABASE A006CBCB, then detach it, EXEC sp_detach_db 'A006CBCB', 'true'overwrite the MDF file for my empty DB with the one from the cd, then reattach the db.EXEC sp_attach_db @dbname = N'A006CBCB', @filename1 = N'D:\SQL\DATA\MSSQL\Data\A006CBCB.mdf', @filename2 = N'D:\SQL\DATA\MSSQL\Data\A006CBCB_log.LDF'Where I hit the following errors:Server: Msg 5173, Level 16, State 2, Line 1Cannot associate files with different databases.Any thoughts? |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2007-01-04 : 17:34:11
|
It sound like you are dealing with a "third party" who has no idea what they are doing.Ask them to send you a SQL Server database backup file.CODO ERGO SUM |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2007-01-04 : 18:12:33
|
Yup, that would be ideal, but sadly not going to happen.The disk is some proprietary stuff they send our clients and expect them to run their install scripts that load the data for some skimpy custom GUI they offer. We're tasked with pulling the underlying data so the data analysis can be automated rather than accessed manually.So if anyone has some thoughts on restoring the data from just a .mdf, please do tell. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-04 : 19:37:36
|
Why do you think you don't need the .ndf file?Peter LarssonHelsingborg, Sweden |
|
|
Kristen
Test
22859 Posts |
|
babaweso
Starting Member
1 Post |
Posted - 2012-08-14 : 10:34:13
|
Just please delete the LDF file thwn normally attach it , it will creat a new onw automaticlly |
|
|
|
|
|
|
|