|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, January 16, 2013 4:11 AM
Points: 1,569,
Visits: 56
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 01, 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.
|
|
|
|
|
Grasshopper
      
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 01, 2012 8:03 AM
Points: 3,
Visits: 28
|
|
| There is "Select * Into.. " statement - creates exact copy of existing table with data.
|
|
|
|
|
Forum 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.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, February 01, 2012 8:03 AM
Points: 3,
Visits: 28
|
|
dan-839063, in this case scenario agreed with you.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, September 30, 2010 12:21 PM
Points: 8,
Visits: 33
|
|
This can be achieved using Import/Export Data feature in SQL 2008.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Yesterday @ 10:49 AM
Points: 438,
Visits: 1,156
|
|
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
|
|
|
|
|
SSCommitted
      
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
|
|
|
|