Dynamic Insert script!!

  • There's one more doubt..

    I have a table X, X is populated in another schema, I have the same table structure, named Y.

    I want a dynamic query which takes each values of each column and builds an insert.

    insert into y values (1,2,3)

    insert into y values (4,5,6)

    There are many datatypes on this table, smalldatetime,smallint, varchar...

    Thanks!!

  • get the script from here:http://vyaskn.tripod.com/code/generate_inserts_2005.txt

    you simply pass the proc the table name,a dn it builds INSERT INTO YOURTABLENAME statements.

    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!

Viewing 2 posts - 1 through 1 (of 1 total)

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