Last post Feb 25, 2015 12:39 AM by jayakumarvinayagam
Feb 24, 2015 03:25 AM|jayakumarvinayagam|LINK
Am doing Console application, it interact with Data base using entity framework, some point of i need to get some record details like pass employeeID, the get Employee details.
there is any way to send bulk employeeId into stored procedure and get respective employee detail. instead of calling iterative process?
Feb 24, 2015 03:47 AM|jayakumarvinayagam|LINK
I got some stuff regarding TVP(table value parameter) to do same logic , please do favor for the same.
Feb 24, 2015 03:34 PM|itpreneur|LINK
If my understand is correct, you want to pass a list of empid and return whatever list of employee info. In this, you are better of creating a stored proc where your parameters is an xml...
In your c# code, call your method with ListEmployees and supply the xml string equivalent....
CREATE PROC ListEmployees( @XML
SELECT Emp.*FROM dbo.Employees where id in (SELECT
Book.value('@id','int') AS empid
Feb 24, 2015 10:04 PM|Kevin Shen - MSFT|LINK
You could use Table-Valued Parameters to insert bulk employeeid into procedure.
Please refer to the tutorial:
But you want to get respective employee details based on the employee id,it seems impossible for you in tvp.
Feb 25, 2015 12:39 AM|jayakumarvinayagam|LINK
I agree with you,, it not possible to using TVP to get it from, better i go with XML manipulation what
itpreneur mentioned, thanks you guy's.
But i wanna know why .Net environment had this restriction, if any one knew about this please share in detail.