You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using SqlKata only to compile. The limit value is not being compiled correctly.
When I run the following query and compile, like:
var query = new Query("GB").Limit(50);
SqlServerCompiler _sqlCompiler = new SqlServerCompiler();
var sqlResult = _sqlCompiler.Compile(query);
return sqlResult.Sql;
the compiled SqlResult.Sql is SELECT TOP (@p0) * FROM [GB]
whereas SqlResult.ToString() is SELECT TOP (50) * FROM [GB]
This is not an issue, this is by design, if you want to execute the queries by yourself and not use the execution package, you have to use the SqlResult.Bindings to get the params value.
Issue
I'm using SqlKata only to compile. The limit value is not being compiled correctly.
When I run the following query and compile, like:
the compiled
SqlResult.Sql
isSELECT TOP (@p0) * FROM [GB]
whereas
SqlResult.ToString()
isSELECT TOP (50) * FROM [GB]
However, the documentation at https://sqlkata.com/docs/#compile-only-example states "Warning: Don't ever use SqlResult.ToString() to execute your queries."
The text was updated successfully, but these errors were encountered: