4

Is it possible to use the sqlcmd command to dump table structure the way it can be done with mysqldump?

Andrew Hopper
  • 956
  • 2
  • 9
  • 20
  • 1
    Duplicate question is answered nicely here: http://stackoverflow.com/questions/1309822/generate-sql-server-scripts-from-command-line – Allanrbo Feb 22 '13 at 22:10

1 Answers1

0

You would need to load on a stored procedure first. The one I keep going back to is:

http://vyaskn.tripod.com/code.htm#inserts

I owe the guy that made it a couple of pints as it has saved me a load of hassle over the years.

Burt
  • 7,680
  • 18
  • 71
  • 127
  • 1
    This is a good tip. Unfortunately it won't work in this case because I don't have permissions to install a stored procedure on the source database. – Andrew Hopper Nov 28 '09 at 20:43
  • 1
    Note this linked stored procedure only dumps the data INSERTs; it doesn't generate table CREATE statements. – Teflon Ted Oct 30 '12 at 18:36