You are here: Re: how to use SP's output in the SELECT Statement « MsSQL Server « IT news, forums, messages
Re: how to use SP's output in the SELECT Statement

Posted by Erland Sommarskog on 09/08/06 10:44

Lucky (tushar.n.patel@gmail.com) writes:
> it's very very simple question for you mighty sql DBAs. but very hard
> for a developer like me who is very very new to MS SQL.
>
> anyways the problem is i want to use one SPs out to in the SELect
> statement. here is an example :
>
> select * from sp_tables tablename like 'syscolumns'
>
> please note that this is just an example. i'm using different SP but i
> want to use in the same way.
>
> if anybody has anything to say. please write to me. i would be glade to
> read your replies

For the precise example of sp_tables, INSERT EXEC is probaly the best way
to go. For procedures you have control over there are better methods. I
happen to have an article on my web site that discusses different options,
http://www.sommarskog.se/share_data.html.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация