• Eugene Elutin (2/21/2012)


    deepkt (2/21/2012)


    Thanks for the reply Eugene Elutin.

    Is there any other way without configuring Ad Hoc Distributed Queries option?

    Thanks

    No! There is none!

    But I still don't understand what you are trying to achieve. Why, in T-SQL, do you need to know the columns datatypes of recordset returned by stored proc?

    BTW, if you call stored proc, which returns recordset, from any client app (eg. reporting tools), you will know column datatypes straight away.

    The problem is that you have to execute the stored procedure first to know the data types. And what if the stored procedure has conditional logic, and the resultset can change?

    Views and functions do not have these issues. IMO, a stored procedure is to do something with the data, not just return it.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP