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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to select single column from resultset

Author  Topic 

BitShift
Yak Posting Veteran

98 Posts

Posted - 2007-02-16 : 11:19:51
If I have a stored procedure that returns several columns, can I feed that to a select statement that just grabs and returns a single column ?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-16 : 11:26:55
insert into a temporary table and do a select from that temporary table.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-02-16 : 12:20:29
...or better yet, change your stored procedure to a user-defined table function. Then you can link to it directly within your SELECT statement.

STAR SCHEMAS ARE NOT DATA WAREHOUSES!
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-02-16 : 13:50:26
Also see this identical topic
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79277


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -