Skip to content
Permalink
Browse files

MSSQL: Fix not displayed column names of current table in data grid f…

…ilter proposal, due to .QuotedName adding the Schema and detecting that as the database name
  • Loading branch information
ansgarbecker committed Jan 18, 2020
1 parent b53ffb3 commit f1c149330f39a844f409b9939f3cdda1ae33dff0
Showing with 5 additions and 3 deletions.
  1. +5 −3 source/main.pas
@@ -6002,11 +6002,12 @@ procedure TMainForm.SynCompletionProposalExecute(Kind: SynCompletionType;
tblname := Conn.DeQuoteIdent(tblname);
DBObjects := Conn.GetDBObjects(dbname);
for Obj in DBObjects do begin
if Obj.Name = tblname then begin
if (Obj.Name = tblname) and (Obj.NodeType in [lntTable, lntView]) then begin
Columns := TTableColumnList.Create(True);
case Obj.NodeType of
lntTable:
lntTable: begin
Columns := Obj.TableColumns;
end;
lntView: begin
Conn.ParseViewStructure(Obj.CreateCode, Obj, Columns, Dummy, Dummy, Dummy, Dummy, Dummy);
end;
@@ -6142,8 +6143,9 @@ procedure TMainForm.SynCompletionProposalExecute(Kind: SynCompletionType;
if Token2 = '' then begin

// Column names from selected table
// Avoid usage of .QuotedName so we don't get the schema in it, see https://www.heidisql.com/forum.php?t=35411
if Editor = SynMemoFilter then begin
AddColumns(ActiveDbObj.QuotedName);
AddColumns(Conn.QuoteIdent(ActiveDbObj.Name));
end;

// All databases

0 comments on commit f1c1493

Please sign in to comment.
You can’t perform that action at this time.