Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2003, 03:15 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default Attach dB Failed

I am having a problem trying to attach a database, I am getting the error below when trying to attach the mdf and ldf through EM.

** Error 5172: The header for the file <File Location ... TextFiles_Log.LDF> is not a valid database file header. The FILE SIZE property is incorrect **

Is there a work around this problem, as I have to attach this dB.
 
Old June 30th, 2003, 03:32 AM
Authorized User
 
Join Date: Jun 2003
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

When you create the database on the server you want to restore to you have the choice of where the location of the mdf and ldf files are to be created e.g. C:\Program Files\Microsoft SQL Server\MSSQL\Data.....

When you try to restore to this database from your backup file, the database you are restoring from has these files (mdf and ldf) in a different location. You need to point to the mdf and ldf of the database you are restoring to.

To do this go to the Options tab in 'Restore Database' and make sure the path in 'Restore database file as:' points to the correct location.

Regards

Nickie
 
Old June 30th, 2003, 03:44 AM
Authorized User
 
Join Date: Jun 2003
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Ignore my last post as its not the fix for the problem you have.

Sorry

Nickie
 
Old June 30th, 2003, 03:49 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Basically I detached the dB, deleted the ldf file (because it was 1GB) and when I tried to reattach the dB may problems began.

I have therefore got a BU from a few days ago of the mdf/ldf files and for some reason I cannot reattach them.

Ian
 
Old June 30th, 2003, 04:06 AM
Authorized User
 
Join Date: Jun 2003
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

Try creating a new database and see if you can restore it to that. You said you deleted the ldf file and it is probable that by restoring the database it is looking for an existing ldf.

Nickie
 
Old June 30th, 2003, 04:25 AM
Authorized User
 
Join Date: Jun 2003
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Strange, just tried to attached a MDF file only and it has worked. Lesson learnt here about making sure BU are available!!!

Thanks for the emails Nickie

Regards
Ian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Error 1813 when attach db to SQL2005 gerten BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 May 27th, 2014 05:10 AM
How can i attach my sig? Pukanhez Forum and Wrox.com Feedback 2 February 2nd, 2009 08:27 AM
Hi, how can i attach signature? puzobok Forum and Wrox.com Feedback 1 September 12th, 2008 10:51 AM
attach data base angelboy SQL Language 1 May 30th, 2007 11:07 AM
Attach Database ! pamyral_279 VS.NET 2002/2003 2 May 17th, 2005 07:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.