Do you know where i can find the famous stored procedure

  • Folks

    Sometime back I had a superb stored procedure that I copied from site in the internet that could

    1.) Create a bunch on insert statements ( you had to only pass the table name )

    Anyone knows where I could find that ?

  • maybe this one from Narayana Vyas Kondreddi?

    http://vyaskn.tripod.com

    I've been using a modified and renamed version of his for years.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Tried that web page. it is not there any more...

    You can share yours if you like.

    The only good thing is he had written in in such a way that it changes the values to OCTAL. This way he did not have to worry about the values that had single quote characters inside varchar fields.

  • mw112009 (2/26/2015)


    Tried that web page. it is not there any more...

    You can share yours if you like.

    The only good thing is he had written in in such a way that it changes the values to OCTAL. This way he did not have to worry about the values that had single quote characters inside varchar fields.

    not sure about octal, but the procedure usp_generate_inserts in this article:

    http://www.sqlservercentral.com/articles/T-SQL/66987/

    builds hex strings for the values, maybe that's what you remember?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • If you are not hung up on needed a stored proc to do this, you can very easily script the content of a database table as a set of INSERT statements using SSMS. Just right click on the database, select "Tasks" and then "Generate Scripts". In the window that pops up, select you table(s), click Next and then click the "Advanced" button. Scroll down to the second screen and you should see an option called "Types of data to script" and it will have a value "Schema only". Change it to "Data only" and then continue to the end of the wizard and you will have a script contain INSERT statements for all of the selected tables.

  • It is up to you how you want to transfer data.

    There are so many options available

    You can use import/export wizard, SSIS, BCP ,script out data and run on other server, Linked server.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply