Friday, January 3, 2014

edmx 4.0 auto populate complex type from store procedure which is returning temp table data

I was facing one problem while using store procedure in edmx 4.0, my store procedure returning one temp table it is executing in sql server properly but when i update the edmx and try to create new complex type then it is not be able to get column information. so automatic complex type is not generating.
The solution of that problem is:

CREATE Procedure [dbo].[TestSp] (@ID int)
AS
BEGIN
SET NOCOUNT OFF
SET FMTONLY OFF


--result table and trace error
DECLARE @Result TABLE
(
    resultText varchar(max) ,
    resultValue varchar(100)
);
--------->>continue rest of sp code

just use that 2 lines, edmx can find that and can create complex type.

No comments:

Post a Comment