Running LINQ generated SQL in SSMS

I am using the LINQ DataContext Log property to send the generated SQL to the debug window. (There is a message from Kris Vandermotten about this). This works fine, except that the calculated SQL parameters are some SQL comments, and therefore I cannot execute the query in Management Studio. Here is an example:

SELECT * FROM table WHERE id IN (@p0,@p1,@p2)
-- @p0: Input Int (Size = 0; Prec = 0; Scale = 0) [5]
-- @p1: Input Int (Size = 0; Prec = 0; Scale = 0) [1]
-- @p2: Input Int (Size = 0; Prec = 0; Scale = 0) [13189086]

So, is there any tool that converts this text to valid SQL?

+3
source share
1 answer

LINQPad (!) LINQ to SQL. "SQL" LINQPad, SQL. DECLARE , / SSMS ( " SQL" SQL, SSMS). LINQPad.

:

LINQPad

+2

Source: https://habr.com/ru/post/1775590/


All Articles