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

Generate Data Script for a Table Expand / Collapse
Author
Message
Posted Monday, September 21, 2009 3:56 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:11 AM
Points: 1,569, Visits: 56
Comments posted to this topic are about the item Generate Data Script for a Table
Post #791011
Posted Monday, September 21, 2009 5:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 1, 2012 8:03 AM
Points: 3, Visits: 28
What the point of this script?
SQL2005/08 has utility "Script Table as.." to create any kind of script.
Post #791042
Posted Monday, September 21, 2009 10:42 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, November 14, 2011 8:55 AM
Points: 20, Visits: 83
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
Post #791304
Posted Monday, September 21, 2009 11:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 1, 2012 8:03 AM
Points: 3, Visits: 28
There is "Select * Into.. " statement - creates exact copy of existing table with data.
Post #791315
Posted Monday, September 21, 2009 12:47 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, February 26, 2010 9:59 AM
Points: 2, Visits: 17
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.
Post #791376
Posted Monday, September 21, 2009 12:56 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, February 1, 2012 8:03 AM
Points: 3, Visits: 28
dan-839063, in this case scenario agreed with you.
Post #791379
Posted Friday, April 16, 2010 11:56 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, October 18, 2013 8:43 AM
Points: 8, Visits: 38
This can be achieved using Import/Export Data feature in SQL 2008.
Post #905099
Posted Tuesday, February 22, 2011 10:24 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, July 11, 2014 4:23 PM
Points: 471, Visits: 1,308
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.

http://sqlblogcasts.com/blogs/seanprice/archive/2007/08/28/data-scripter-add-in-for-management-studio.aspx
Post #1067729
Posted Wednesday, February 23, 2011 7:44 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:11 AM
Points: 1,569, Visits: 56
Thanks

Will take a look.

Regards,

Sudhir
Post #1068269
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse