TOP(x) clause for UPDATES + DELETES introduced in MSSQL 2005. Do not use that on older servers. See http://www.heidisql.com/forum.php?t=13289

This commit is contained in:
Ansgar Becker
2013-08-28 03:52:34 +00:00
parent 110d9c585c
commit fddad4669f

View File

@@ -3739,9 +3739,11 @@ begin
Result := QueryType + ' ';
case FParameters.NetTypeGroup of
ngMSSQL: begin
if QueryType = 'UPDATE' then
Result := Result + 'TOP('+IntToStr(Limit)+') '
else if QueryType = 'SELECT' then
if QueryType = 'UPDATE' then begin
// TOP(x) clause for UPDATES + DELETES introduced in MSSQL 2005
if ServerVersionInt >= 900 then
Result := Result + 'TOP('+IntToStr(Limit)+') ';
end else if QueryType = 'SELECT' then
Result := Result + 'TOP '+IntToStr(Limit)+' ';
Result := Result + QueryBody;
end;