How Can I export/inport my database into and from a CSV/SQL file?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kabyr
    New Member
    • Nov 2007
    • 29

    How Can I export/inport my database into and from a CSV/SQL file?

    I have created a database for an application.

    Some of the tables in the database contain initial data required to run the application and some of the data are more than 1000 records.

    I need to export this data into an sql,txt or scv file so that during installation, i can just run a database creation script to inport it into a new database just like you create oracle dump.

    I do not want to run the data migration wizard every time i have to install the application.

    Thank you in advance.
  • gpl
    New Member
    • Jul 2007
    • 152

    #2
    If it is a Microsoft SQL Server database, you can use Enterprise Manager - Data Transformation Service to export the data into csv files

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Or you can create a template database, back that up and just restore it during installation.

      Good Luck!!!

      ~~ CK

      Comment

      • Kabyr
        New Member
        • Nov 2007
        • 29

        #4
        Thank you for your replies. One of the things I am avoiding is using the Enterprise Manager to export the database and in case I suceed with that. How do I import it using code?

        Second is if I have to backup the database from MS SQL Server, Can I achieve that with code? if yes how do I restore on client machine using code.

        The high point of all these is that I am working with VB6 and just want to have this put together, and called from VB. Once done, I want to package everything on an installation disk. I dont have to be there when they need to do a new installation.

        Thank you for the help.

        Comment

        • NeoPa
          Recognized Expert Moderator MVP
          • Oct 2006
          • 32634

          #5
          BACKUP and RESTORE commands are available in T-SQL. They are quite flexible and allow you a great deal of control. There is far too much in there to cover here, so I suggest you look in Books Online for each command as you are setting them up.

          Your original backup (done whenever you have a new version to release) can be done either with code or through the Management Studio interface.

          The installation routine would need to include the RESTORE code to apply the full copy of the database onto the new server.

          Welcome to Bytes!

          Comment

          • Kabyr
            New Member
            • Nov 2007
            • 29

            #6
            Thank you for the help.

            Comment

            Working...