Add column at ordinal position programmatically

  • I just reviewed the latest version Lowell, and it's freakin' awesome. I can't believe how much work you must have put into this.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Lowell, are you going to update your posted script here at SSC? I point people from other sites to it all the time.

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

  • Thank you! I consider that very high praise coming from you!

    I'll submit both the 2000 and the 2005 scripts to the scripts here;

    I had slapped together an article on it for the version that was all cursors, now that the script is much improved, i should resubmit.

    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!

  • The script for SQL 2000 still needs some adjusting. It's using a CROSS APPLY and a FOR XML that the query analyzer is complaining to me about. I got side-tracked with another project and haven't had time to update it yet.

    But, I agree, it's still freakin awesome!

    Matthew

  • dayum, i must have tested in a compatibility 90 database....sorry.

    that was a bit of work to fix, but i figured out how to update the @Results table witht eh columns as a separate step, with a bit of cleanup afterwards, and this time i tested in a SQL2000 installation, instead of what i thougth was compatibility mode 80. doh!

    i fixed it, and the updated proc is on the same links as before. the 2005 is still the same.

    Get DDL for any SQL 2005 table

    Get DDL for any SQL 2000 table

    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 5 posts - 16 through 20 (of 20 total)

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