SQL Server Performance Forum – Threads Archive
MDF IntegrityHi all,
Is there any way to check the integrity of .Mdf file before Attaching it to a database means to check whether its valid (or) not. Thanks. //Najeed.
I don’t think there any of check the integrity/validity of .mdf file… But you can use undocumented dbcc to see the file info which used while atttaching the files…I have tested this in 2000 but not in 2005… dbcc checkprimaryfile (‘C: est.mdf’, 2)
dbcc checkprimaryfile (‘C: est.mdf’, 3)
SQL-Server-Performance.com All postings are provided â€œAS ISâ€ with no warranties for accuracy.
If ain’t attaching then the integrity is failed [<img src=’/community/emoticons/emotion-1.gif’ alt=’‘ />], as suggested you might take help of that but ensure you have additional backup just in case that corrupts, undocumented DBCC statements are unpredictable.<br /><br /><b>Satya SKJ</b><br />Microsoft SQL Server MVP<br />Writer, Contributing Editor & Moderator<br /<a target="_blank" href=http://www.SQL-Server-Performance.Com>http://www.SQL-Server-Performance.Com</a><br /><center><font color="teal"><font size="1">This posting is provided AS IS with no rights for the sake of <i>knowledge sharing. <hr noshade size="1">Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.</i></font id="size1"></font id="teal"></center>