delete *.ldf & *.mdf

Results 1 to 2 of 2

Thread: delete *.ldf & *.mdf

  1. #1
    Join Date
    Dec 1969

    Default delete *.ldf & *.mdf

    Is it ok to delete the data from these files ? <BR><BR>Is there any way to delete the data from these files through the querry analyzer with a statement?<BR><BR> if so please help me (desperately needed)<BR>My main problem is i cant run some of my .asp files as i get the eorror # error &#039;80020009&#039; Exception occurred. <BR><BR>and in some .asp i get the error that primary file group is full so couldn&#039;t write the data.<BR>so free up the file storage size. I called up my server company they dont even respond. so in a major mess. Need to find out if i can freeup from the space what i alread have.<BR>I have 110mb of ql server space, only 15mb is the database and the space reserved for .mdf is 4 mb now is there any way i can clear the transaction log and the log of .mdf so i can reuse the space what i already have<BR>PLease help me ... <BR>Neena<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default Chuckle...

    These are the primary database files for a specific database in SQL Server. You can Detach the database (make sure you update statistics) from SQL Server. From there, you can move these two files anywhere you like to free up space.<BR><BR>Incidently, if you wanted to learn how to perform this via VBScript in a scheduled job, you may find this example helpful:<BR><BR><BR><BR>Just strip out the lines that deal with the full text catalog down to just before the .Disconnect method.<BR>Between the DetachDB and AttachDB, you can put in code to zip up the file and copy it somewhere if you like.<BR><BR>*** As long as you update statistics BEFORE you detach the database, the .ldf and .mdf files can be totally portable and reattached either programmatically (as shown in the above example) or by right clicking on the Databases icon in the Enterprise Manager tree and selecting to attach a database.<BR><BR>Have fun...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts