mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Do not use TOP 1 in DELETE queries on MS SQL servers. Fixes issue #2690.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user