September 21, 2009 at 3:56 am
Comments posted to this topic are about the item Generate Data Script for a Table
September 21, 2009 at 5:57 am
What the point of this script?
SQL2005/08 has utility "Script Table as.." to create any kind of script.
September 21, 2009 at 10:42 am
This one captures the table's existing data, creating a series of insert statements. The "Script table as..." functionality in Management Studio only creates skeletal statements, not for generating an insert script reloading table data.
Russell T. Gould, Ph.D.
Medford, Oregon
September 21, 2009 at 11:09 am
There is "Select * Into.. " statement - creates exact copy of existing table with data.
September 21, 2009 at 12:47 pm
The SELECT INTO FROM method requires a live DB to query data from. It does not give you a saved, standalone re-runnable script that you can use at a later date to populate an empty database's lookup tables with values for the lookup data (i.e. AddressType, CountryList, StateList, CurrencyType, SuffixType, etc...
This proc generates a script with the data contained within it, which you may need somewhere else or at some other time.
September 21, 2009 at 12:56 pm
dan-839063, in this case scenario agreed with you. 🙂
April 16, 2010 at 11:56 am
This can be achieved using Import/Export Data feature in SQL 2008.
February 22, 2011 at 10:24 am
This isn't bad, but personally I use something called Data Scripter (It's from the "I want some Moore" blog, and appears to have been written by a Sean Price).
It's basically the same as your PROC, but it's an add-in for SSMS that becomes available to your Right-Click options for any given table in your db.
February 23, 2011 at 7:44 am
Thanks
Will take a look.
Regards,
Sudhir
May 24, 2016 at 6:48 am
Thanks for the script.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply