Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12»»

how to create a flat file from SQL tables Expand / Collapse
Author
Message
Posted Tuesday, November 27, 2012 8:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 28, 2012 11:36 AM
Points: 6, Visits: 6
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
Post #1389222
Posted Tuesday, November 27, 2012 8:20 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 6, 2012 2:49 PM
Points: 140, Visits: 310
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
Post #1389223
Posted Tuesday, November 27, 2012 8:27 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 28, 2012 11:36 AM
Points: 6, Visits: 6
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,
Post #1389228
Posted Tuesday, November 27, 2012 8:38 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, December 6, 2012 2:49 PM
Points: 140, Visits: 310
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.
Post #1389241
Posted Tuesday, November 27, 2012 12:26 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 28, 2012 11:36 AM
Points: 6, Visits: 6
Thanks Pavan,
I will give it a try.
S.
Post #1389376
Posted Wednesday, November 28, 2012 4:43 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 28, 2012 11:36 AM
Points: 6, Visits: 6
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
Post #1389639
Posted Wednesday, November 28, 2012 5:50 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:14 AM
Points: 5,672, Visits: 6,481
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 Administrator

Webpage: http://www.BrandieTarvin.net
LiveJournal Blog: http://brandietarvin.livejournal.com/
On LinkedIn!, Google+, and Twitter.

Freelance Writer: Shadowrun
Latchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.
Post #1389681
Posted Wednesday, November 28, 2012 6:31 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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?




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1389708
Posted Wednesday, November 28, 2012 6:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, November 28, 2012 11:36 AM
Points: 6, Visits: 6
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.
Post #1389737
Posted Wednesday, November 28, 2012 6:55 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
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




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1389743
« Prev Topic | Next Topic »

Add to briefcase 12»»

Permissions Expand / Collapse