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 12345»»»

Generating Insert Statements Expand / Collapse
Author
Message
Posted Tuesday, June 30, 2009 9:29 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, November 18, 2014 11:47 AM
Points: 1,676, Visits: 1,759
Comments posted to this topic are about the item Generating Insert Statements
Post #745044
Posted Wednesday, July 1, 2009 2:21 AM


Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Wednesday, May 28, 2014 12:41 PM
Points: 324, Visits: 188
Excellent article!
Actually exactly what I needed!
Coming from SQL Server over MySQL and back to SQL Server - suddenly - it annoyed me as @#%& that moving from development to production there was no way of moving the data. (Yes: backup and restore, but in a live environment you don't really want to do that, do you?)

I will tweak it a bit - also generating the actual table prior inserting.
Hopefully I will get it done and I'll post it here - if no one beats me to it...
Post #745163
Posted Wednesday, July 1, 2009 2:46 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 6:34 AM
Points: 288, Visits: 1,078
Nice idea.

An alternative is to use SSMS 2008's in-built data scripting functionality:

http://www.sqlskills.com/BLOGS/PAUL/post/Scripting-schema-AND-data-with-SSMS-in-SQL-2008.aspx

Chris
Post #745177
Posted Wednesday, July 1, 2009 4:45 AM
Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Wednesday, October 8, 2014 7:55 AM
Points: 772, Visits: 242
It is an amazing idea.
Post #745231
Posted Wednesday, July 1, 2009 5:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, September 5, 2014 11:20 AM
Points: 5, Visits: 102
Looking forward to adapting your code to our environment. Excellent article -- well written. You've raised the bar for other authors.

One small nit -- it's couldn't care less.

Hope to see you post more.
Post #745258
Posted Wednesday, July 1, 2009 6:49 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Sunday, November 4, 2012 12:23 PM
Points: 1,893, Visits: 3,932
Nice article and really well written.

Same idea as mine:
http://www.sqlservercentral.com/scripts/Script+Data/65998/



The more I learn, the more I know what I do not know
Blog: Things about Software Architecture, .NET development and T-SQL

How to Post Data/Code to get the best Help How to Post Performance Problems
Post #745314
Posted Wednesday, July 1, 2009 6:56 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 9:43 AM
Points: 98, Visits: 264
Brilliant!!! Outside-the-box thinking that turns conventional processes on their head.

Thank you, Oleg.

Jeff Bennett
SQL DBA
Saint Louis, MO



Post #745320
Posted Wednesday, July 1, 2009 7:01 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 11:11 AM
Points: 5,366, Visits: 8,981
Chris Howarth (7/1/2009)
Nice idea.

An alternative is to use SSMS 2008's in-built data scripting functionality:

http://www.sqlskills.com/BLOGS/PAUL/post/Scripting-schema-AND-data-with-SSMS-in-SQL-2008.aspx

Chris

I just love it when I start the day off learning something new. With this link, and with the article showing how to do the inserts as binary data, I've learned two things.

Great article, and good link here ... I didn't know that this was in SSMS2008.
Edit: quoted wrong message when posting.


Wayne
Microsoft Certified Master: SQL Server 2008
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #745326
Posted Wednesday, July 1, 2009 7:32 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, October 1, 2014 6:34 AM
Points: 288, Visits: 1,078
Another new feature of SQL Server 2008 is an extension to the CONVERT function whereby a binary value can be converted to a string representation.

e.g.

SELECT CONVERT(VARCHAR(MAX), 0x484920544845524521, 1)

...returns:

0x484920544845524521

This removes the need for a 'BinToHexStr' function.

Chris
Post #745372
Posted Wednesday, July 1, 2009 8:56 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Friday, November 21, 2014 1:42 PM
Points: 10,340, Visits: 13,341
Nice article and very helpful for 2000 and 2005. As mentioned the capability to script data is now part of SSMS 2008.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #745478
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse