I have the following in a stored procedure:
DECLARE @Query varchar(8000)
SET @Query = N'SELECT * FROM OPENQUERY(SERVER, ''' + REPLACE(@Query, '''', '''''') + ''')'
For some reason Linq won't auto generate a return type. Even if I create a temp table and insert the results of the EXEC into the table and then select from it Linq still refuses to generate a return type.
How can I get this to work?Thursday, March 26, 2009 10:16 PM
Unfortunately, nothing will get it to work. The mechanism in SQL Server that provides this information returns nothing when the stored procedure uses a temp table or a dynamic query (via exec). You'll have to specify the signature of the method by hand in the source code.
Wayward LINQ LackySunday, April 19, 2009 2:01 AM
I had the same issue and while editing the dbml file by hand worked fine, the easier 'fix' was to simply comment out the 'exec' line in the stored procedure, then drag the stored procedure into the model, save, then uncomment the exec line in the stored procedure again... of course that is only going to work if the procedure uses a select statement to return the data.Sunday, August 23, 2009 6:02 AM