hudsonbeck
asked on
Attach Single File (MDF) Problem
Hey,
I got sent a mdf file that i need to attach to my sql server (2k).
I thought this would be pretty stright forward but it looks like i was worng. I am not a guru in SQL or server admin but i have gotten along decently in the past.
I try to attach using this command
exec sp_attach_single_file_db @dbname = 'cadi_4_13'
, @physname = 'c:\cadi_4_13.mdf'
and i get this error message:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'c:\cadi_4_13.mdf' is not a valid database file header. The FILE SIZE property is incorrect.
I have seen several places where people have this issue.
I am running sqlserver 2k.
Can someone please take me through (step-by-step) what exactly i am "susposed" to be doing?
I am actually running that in the Query analyzer, but i have tried a stored procedure and to generate a sql script, but i dont know how to execute them except for in a job.... I hope you see where my level is in the matter :)
Thanks in advance for your help,
Chris
I got sent a mdf file that i need to attach to my sql server (2k).
I thought this would be pretty stright forward but it looks like i was worng. I am not a guru in SQL or server admin but i have gotten along decently in the past.
I try to attach using this command
exec sp_attach_single_file_db @dbname = 'cadi_4_13'
, @physname = 'c:\cadi_4_13.mdf'
and i get this error message:
Server: Msg 5172, Level 16, State 15, Line 1
The header for file 'c:\cadi_4_13.mdf' is not a valid database file header. The FILE SIZE property is incorrect.
I have seen several places where people have this issue.
I am running sqlserver 2k.
Can someone please take me through (step-by-step) what exactly i am "susposed" to be doing?
I am actually running that in the Query analyzer, but i have tried a stored procedure and to generate a sql script, but i dont know how to execute them except for in a job.... I hope you see where my level is in the matter :)
Thanks in advance for your help,
Chris
ASKER
SOmeone sent it to me so i really dont even know what version... I tried 97 and 2k.. but if even a hotfix can make it not work, what would be the best way for them to send me the db so i can "attach" it to my sql server. We will be doing some work on the data for them.
Chris
Chris
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
sry had a unexpected trip... accepted anwser and i appreciate ur help
Chris
Chris
1. You're trying to attach this file to a different version of SQL Server than where it came from (even a hotfix makes a difference).
2. The file you received was corrupt