Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / Other Technologies / Full-Text Search / May 2008

Tip: Looking for answers? Try searching our database.

Nested Stored Procedure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Riddick1980 - 15 May 2008 17:46 GMT
Can I use a stored procedure as table inside a stored procedure?
for eg. i have a stored procedure named QMENU and QNEWMENU
I want to use these two stored procedures in another stored procedure like:

CREATE PROCEDURE MENU(@roll1 as INT)
AS
BEGIN
   SELECT * FROM QMENU;
   UNION ALL;
   SELECT * FROM QNEWMENU;
END

Thnx in advance,
Olaf Pietsch - 15 May 2008 18:15 GMT
> Can I use a stored procedure as table inside a stored procedure?
> for eg. i have a stored procedure named QMENU and QNEWMENU
[quoted text clipped - 8 lines]
>    SELECT * FROM QNEWMENU;
> END

No, it is not possible to use SP in this way.

But you can use a User Defined Function (UDF) instead which return a table.

Table-Valued Functions
http://www.sqlteam.com/article/intro-to-user-defined-functions-updated

SQL Server 2005 Books Online
CREATE FUNCTION (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms186755.aspx

Signature

Gruß Olaf
Ich unterstütze PASS Deutschland e.V. (http://www.sqlpass.de)
Blog (http://www.sqlpass.de/PASSUserBlogs/tabid/178/Default.aspx?BlogID=3)
Regionalgruppe Köln/Bonn/Düsseldorf
(http://www.sqlpass.de/Regionalgruppen/KoelnBonnDuesseldorf/tabid/81/Default.aspx)

keyur joshi - 17 May 2008 13:24 GMT
> Can I use a stored procedure as table inside a stored procedure?
> for eg. i have a stored procedure named QMENU and QNEWMENU
[quoted text clipped - 9 lines]
>
> Thnx in advance,
keyur joshi - 17 May 2008 13:25 GMT
Can I use a stored procedure as table inside a stored procedure?
> for eg. i have a stored procedure named QMENU and QNEWMENU
> I want to use these two stored procedures in another stored procedure like:
[quoted text clipped - 8 lines]
>
> Thnx in advance,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.