13

alt text http://www.freeimagehosting.net/uploads/64fac9c8c4.gif

is it possible to generate sql scripts from for all tables ? i want to generate the sql script and import into another database server

jitter
  • 53,475
  • 11
  • 111
  • 124
cometta
  • 35,071
  • 77
  • 215
  • 324
  • 1
    What type of database server is it? If it's mysql, look into mysqldump, a command line utility. Most popular database servers have a similar type of program. Unfortunately, I'm not familiar with the Squirrel SQL Client program... Mysqldump: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html – Ben Jun 30 '09 at 06:25
  • i use squirrel-sql to connect to oracle10g – cometta Jun 30 '09 at 06:29
  • @Ben - doesn't really answer the question, but it was what I needed anyway so thanks. :-) – fool4jesus Dec 17 '11 at 15:32

2 Answers2

22

Select the tables you want to export, right click, scripts>create table script. It works in mysql, not sure about oracle.

luarwo
  • 253
  • 3
  • 8
  • 3
    If you're wondering where the script goes, it puts it into the SQL window. For me, it was getting some errors and dying, so I used mysqldump as suggested above. – fool4jesus Dec 17 '11 at 15:33
  • Would be great if there was a way of doing this for all tables in one go. – Will Sewell Mar 14 '13 at 23:42
  • And Scripts -> Create Data Script for table contents. Don't know if this works with bigger data sets. – Touko May 26 '14 at 13:03
0

For anyone on the 3.4.0 version on OSX, I had to do it this way:

Select the DB
Session >> SQL Server >> Generate T-SQL Script
Select the Objects/Tables wanted

Saves to a file, but gives you no progress indicator, so give it a while to run.

mondo
  • 334
  • 1
  • 2
  • 8