Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2003-12-02 : 08:26:03
|
| Thomas writes "How do I get all columns (including type) that are returned by a stored procedure?I can use "SET FMTONLY ON" but this seems not to work with STPs which are using a temporary table." |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2003-12-02 : 12:20:39
|
| What do you mean all columns that are returned by a stored procedure? Is the stored procedure returning a result set or an OUTPUT parameter? If not, then you need to code it so that it does. Here is an example of a result set:CREATE PROC SomeProcASSELECT Column1, Column2FROM Table1WHERE Column3 = 0RETURNThe above stored procedure will return Column1 and Column2 as a result set. Show us your stored procedure and let us know what you want returned. And yes stored procedures can return result sets from a temporary table. But you can to tell it to do it.Tara |
 |
|
|
jcortiz1
Starting Member
3 Posts |
Posted - 2004-07-27 : 17:23:16
|
Please.The stored procedure is returning a result set!!! by example:CREATE PROC SomeProcASSELECT Column1, Column2FROM Table1WHERE Column3 = 0RETURNjcortiz1 |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-07-27 : 18:08:28
|
| What is your question?Tara |
 |
|
|
Pat Phelan
Posting Yak Master
187 Posts |
Posted - 2004-07-27 : 18:23:56
|
| Can we back up a step or two, and try to figure out what you're trying to accomplish instead of concentrating on details?It sounds to me like the question is related to how an application can retrieve a stored procedure if that application doesn't know the format of the result set(s) in advance. One of the problems that the question as posted seems to ignore is that a procedure can return multiple result sets in a single call or in response to different parameters, so a procedure doesn't have to have only one schema.Can you try to explain what you are trying to do, without getting too bogged down in how you are trying to do it?-PatP |
 |
|
|
Kristen
Test
22859 Posts |
|
|
|
|
|