Fix empty query body when deleting grid rows in MSSQL mode, broken in b9b5976413dc6ff35e9e947816cc7264161b88f1. Closes #1294

This commit is contained in:
Ansgar Becker
2021-01-26 21:46:25 +01:00
parent d5d7e145a9
commit 2ded25f76c

View File

@ -6696,7 +6696,7 @@ begin
Result := QueryType + ' ';
case FParameters.NetTypeGroup of
ngMSSQL: begin
if QueryType = 'UPDATE' then begin
if (QueryType = 'UPDATE') or (QueryType = 'DELETE') then begin
// TOP(x) clause for UPDATES + DELETES introduced in MSSQL 2005
if ServerVersionInt >= 900 then
Result := Result + 'TOP('+IntToStr(Limit)+') ';
@ -6711,7 +6711,8 @@ begin
// OFFSET not supported in < 2012
Result := Result + 'TOP ' + IntToStr(Limit) + ' ' + QueryBody;
end;
end;
end else
Result := Result + QueryBody;
end;
ngMySQL: begin
Result := Result + QueryBody + ' LIMIT ';