Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 calling stored procedure into table value function
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gagani
Posting Yak Master

112 Posts

Posted - 03/11/2013 :  18:18:30  Show Profile  Reply with Quote
I need call the stored procedure into a table valued function
(stored procedure will return a table)

Create Function dbo.Function1() Returns @Result Table

(

Result Varchar(1000)

)

As

Begin

Insert @Result

SELECT * from 'Exec dbo.crosstab'
// HOW TO CALL THE STORED PROCEDURE RESULTS INTO THE FUNCTION
Return

end

Go

robvolk
Most Valuable Yak

USA
15732 Posts

Posted - 03/11/2013 :  22:43:25  Show Profile  Visit robvolk's Homepage  Reply with Quote
You can't execute procedures or dynamic SQL inside a user-defined function.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 03/12/2013 :  01:20:27  Show Profile  Reply with Quote
you can do the inverse though...ie calling udf inside stored procedure

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000