Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

Table-values function that returns result of execution stored proc. How to?


Welcome.
This is my first post in this group. I have a problem. I tried to
create a table-valued function that returns
a table as a result of execution stored procedure. Procedure
dbo.uspGetEmployeeManagers is available in AdwentureWorks database. I
have created such thing linke below, but it doesn't work. Can anyone
help me?

PS: Sorry for my english. I still learn it.

CREATE FUNCTION dbo.GetStoredProcedureResult
(
        @employeeID int
)
RETURNS @temp TABLE(
        recursion int,
        empID int,
        name varchar(256),
        surname varchar(256),
        managerID int,
        managerName varchar(256),
        managerSurname varchar(256)
)
BEGIN
        INSERT INTO @temp(recursion, empID, name, surname, managerID,
managerName,managerSurname)
        VALUES(EXEC dbo.uspGetEmployeeManagers 1)
        RETURN
END
GO

cox
As I remember you cannot use EXEC() in UDF.

<c@o2.pl> wrote in message

news:1181211722.499951.286530@q66g2000hsg.googlegroups.com...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc