Extended Stored Procedure Returning One Column, not one Row

  • Hello Everyone

    I am still working with one of the extended stored procedures. One comes back in normal table form, and one comes back with one column and many rows.

    OK, so how can take the results of executing the extended sproc, and insert them into a table?

    This is what I have when I execute it:

    Name StoredValue

    Product Name Value

    Product Version Value

    Engine Version Value

    Registration Name Value

    Restore only support Value

    Professional Edition Value

    Developer Edition Value

    MSDE Edition Value

    Has Site License Value

    Classic Edition Value

    Number of CPU's Value

    Encryption Support Value

    Gigabyte limit Value

    Days installed Value

    How can i possible turn this into a normal table? I have tried using Pivot, but I am doing something that something does not like. I am not sure if it has to do with the extended sproc or not.

    Thanks in advance

    Andrew SQLDBA

  • You may create table and insert the result into it. Here is an example

    create table xpinfo

    (

    column1 varchar(500),

    column2 varchar(500),

    column3 varchar(500),

    column4 varchar(500),

    )

    insert into xpinfo exec xp_msver

    go

    select * from xpinfo

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • AndrewSQLDBA (8/4/2010)


    How can i possible turn this into a normal table? I have tried using Pivot, but I am doing something that something does not like. I am not sure if it has to do with the extended sproc or not.

    Thanks in advance

    Andrew SQLDBA

    Can't help with your code if you don't post it or any sample data but I can definately tell you that either a cross-tab (my favorite) or a pivot will do the trick. You got 382 points so you're not exactly a newbie which means that it's probably been suggested to you to read an article that tells you how to post data to get the best help. In case you're still interested in getting better help, that article is at the 1st link in my signature line below. 😉

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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