Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

MSSQL: Database table overview wrong #462

Closed

Description

Using the Falcon SQL Client v2.8.0 under Windows 7 and connecting to a Microsoft SQL Server where multiple databases reside, I get the wrong table overview for the database. The tables shown and the corresponding columns in the dropdown correspond to other databases present on the server. Queries on the 'correct' database, the one I actually connected to, work.

Activity

  1. changed the title [-]Database table overview wrong[/-] [+]MSSQL: Database table overview wrong[/+] on Jun 22, 2018
  2. n-riesco commented on Jun 22, 2018

    @n-riesco
    Contributor

    Please, could you check what errors are reported in the log file %USERPROFILE%\.plotly\connector\log.log?

    In particular, I'm interested in errors with the responses to sql-tables and sql-schemas.

  3. n-riesco commented on Jun 22, 2018

    @n-riesco
    Contributor

    Oh! it looks like when we get the tables schemas we don't filter by database name.

    Currently, we are using this query to build the overview:

                    SELECT T.name AS Table_Name, C.name AS Column_Name, P.name AS Data_Type
                    FROM sys.objects AS T
                       JOIN sys.columns AS C ON T.object_id = C.object_id
                       JOIN sys.types AS P ON C.system_type_id = P.system_type_id
                    WHERE T.type_desc = 'USER_TABLE';

    After some experimentation, this query works for me:

    SELECT table_name, column_name, data_type
    FROM information_schema.columns
    WHERE table_catalog = '${database}'
    ORDER BY table_name

    @pabucur please, could you check whether the above query works for you? You need to replace ${database} by your database name.

  4. self-assigned this
    on Jun 22, 2018
  5. added 2 commits that reference this issue on Jun 22, 2018
    a8208b2
    a9bebda
  6. added a commit that references this issue on Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions