SQL Server Forums
Profile | Register | 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
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

gagani
Yak Posting Veteran

94 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
15635 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
52249 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000