Do not use TOP 1 in DELETE queries on MS SQL servers. Fixes issue #2690.

This commit is contained in:
Ansgar Becker
2012-01-18 20:23:33 +00:00
parent 9710a8363e
commit 0d6d41d14f

View File

@ -3112,12 +3112,13 @@ end;
function TDBConnection.ApplyLimitClause(QueryType, QueryBody: String; Limit, Offset: Cardinal): String;
begin
QueryType := UpperCase(QueryType);
Result := QueryType + ' ';
case FParameters.NetTypeGroup of
ngMSSQL: begin
if UpperCase(QueryType) = 'UPDATE' then
if QueryType = 'UPDATE' then
Result := Result + 'TOP('+IntToStr(Limit)+') '
else
else if QueryType = 'SELECT' then
Result := Result + 'TOP '+IntToStr(Limit)+' ';
Result := Result + QueryBody;
end;