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

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 functions

Author  Topic 

Arun.G
Yak Posting Veteran

81 Posts

Posted - 2010-07-13 : 02:56:36
my input argument is emp_id

then i should display

1) employee name
2) org_id and name of the input emp_id
3) list of employees under the organzation of the given emp_id's org
4) list of employees and collegues in the same org
5) list of employees whoall r reporting to same manger as given emp_id's reporting manger


v can do all this seperately through stored procedures,

but how can v do this with only one function should satisfy all the above 5 things?

pls suggest some sample coding and ideas?

Sachin.Nand

2937 Posts

Posted - 2010-07-13 : 03:15:37
You can do this by using a table valued function which will return all your desired data.
Have a look here

http://msdn.microsoft.com/en-us/library/ms191165.aspx


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page
   

- Advertisement -