how to create a flat file from SQL tables

  • Hi,

    I am trying to create a flat file from a database. I am just learning how to work on sql so any help would be greatly appreciated!

    Saul

  • Is it a database or a table?

    If table, you can use export / bcp to copy the contents of the table to a flat file.

    Pavan

  • Hi Pavan,

    The idea is to create a back up of the database on a flat file. It could be by tables.though

    I did use mysql workbench to update an existing DB but now I was asked to create a back up on a flat file.

    Thanks,

  • Why do you want to create the backup on a flat file, use SQL native backup tool and take the backup.

    If you have to backup all tables on flat files, then you might have to do it for every table seperately.

    You can use Export data / bcp / SSIS package etc.

    Pavan.

  • Thanks Pavan,

    I will give it a try.

    S.

  • Hey Pavan,

    some how is not working, it is giving me an error messages. It is a syntax error... sorry I am still learning SQL..

    Thanks!

    S

  • ssarria (11/28/2012)


    Hey Pavan,

    some how is not working, it is giving me an error messages. It is a syntax error... sorry I am still learning SQL..

    Thanks!

    S

    Please post all your code and the exact text of your syntax error. We can't help you if we don't know what you're looking at.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • ssarria (11/27/2012)


    Hi Pavan,

    The idea is to create a back up of the database on a flat file. It could be by tables.though

    I did use mysql workbench to update an existing DB but now I was asked to create a back up on a flat file.

    Thanks,

    Are you using SQL or MySQL?

  • I ma using MySQL.

    I believe, what I need is to create a flat file that could be used as a backup in case of something happen to the database.

    I am not sure of what commands to use without putting on risk my DB.

  • This is a Microsoft SQL server forum, not a MySQL forum, you might be best using a dedicated MySQL forum.

    But a quick google search for "export mysql db to file" brought it a number of results which might help you out.

    https://www.google.co.uk/search?q=export+mysql+db+to+file

  • Thxs Anthony.

    S

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply