SET @Query = N'SELECT * FROM OPENQUERY(SERVER, ''' + REPLACE(@Query, '''', '''''') + ''')'
EXEC(@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.
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 Lacky
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.
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.