I have a request as below for auditing purpose on Microsoft Dynamic GP database.

  1. Database files are required as .mdf and .ldf files for certain companies
  2. Only need the certain period time of data, not entire database from day 1 till now

My questions:

  1. Is this even possible to provide only certain period time of activities from database as .mdf file? I mean if the .mdf file is required, it must be the entire database right?

  2. If it is possible, how? Query the database for everything happened in that period of time and save it as .mdf file and .ldf file? Or somehow somewhat cut the .mdf file? I don't think so...

  3. or if I provide entire database with only that period of transaction log?

I posted this question on overflow, It should be posted here.


1 Answer 1


The way to handle this is to create a new database with a different name (for example, MyDB_Export), then use the Export functionality in Sql Server Management Studio - right-click on the database in SSMS, and click Tasks / Export Data... on the pop-up menus. The only thing you will do is to specify a query to select the data to export to the new DB.

Its pretty intuitive to walk through the steps, so you should be able to work out how to complete this easily once you are in the Import/Export Wizard. If not, just add a comment below and I'll expand on this.

  • Yes, I thought about "export" options, but I don't think it is doable if I don't know exactly what to query, there are over 2k tables and I don't even know what table is holding what info.
    – Root Loop
    Commented Feb 4, 2019 at 19:26
  • I guess there is no way to just "export" all activities (doesn't matter what ) on a given period of time? Lets say export "everything" in 2008 from this dababase?
    – Root Loop
    Commented Feb 4, 2019 at 19:28
  • 2
    This is the best resource there is on GP: victoriayudin.com/gp-reports As I recommended on your SO post, figure out what this entity is really asking of you. You do not want to provide MDF files as an audit. It is effectively impossible to guarantee data correctness this way. This is financial data. If the wrong data is sent to the IRS or whatever auditor is asking for this it will be a huge mess. Your best bet is to learn the tables and query the data or, most likely, contact a Microsoft partner that specializes in doing this.
    – Jacob H
    Commented Feb 4, 2019 at 21:35
  • I use that gp resource site all the time. it is a good one.
    – Root Loop
    Commented Feb 5, 2019 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.