how to access SSMS table using JDBC with Python

Miroslav Muras 25 Reputation points
2023-06-26T16:55:47.9633333+00:00

Service: 

Using Azure Synapse Python Spark.

Scenario:

While Reading data from SSMS using Azure Synapse Spark, I'm getting an “Invalid object name” error.

Result:

Trying to access /SELECT existing table in the SSMS. When executed, I get an "Invalid object name" error. The table is in the DB as External Table and a View table. Can you please direct me to troubleshoot/Debug? Thank you.

User's image

User's image

User's image

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,316 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,494 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Erland Sommarskog 120.2K Reputation points MVP
    2023-06-26T21:47:59.7933333+00:00

    I don't work much with Synapse, so I cannot be that much of help. But I notice one this which is entirely wrong. You talk about an "SSMS table". There are no tables in SSMS. SSMS is only a tool talk to database servers like SQL Server or Azure Synapse.

    The table Table_FaultCodeRelatedRepairs_Vw may be visible in SSMS, but that does not mean that you access it from your serverless pool. For all we know, it could be located in an SQL Server instance elsewhere. You will need investigate this a little more closely.


  2. AnnuKumari-MSFT 34,456 Reputation points Microsoft Employee
    2023-07-07T09:23:41.2966667+00:00
    1. Ensure that the table name is correct and that it exists in the database. The "Invalid object name" error usually occurs when the table name is incorrect or the table does not exist in the database.
    2. Ensure that the table name is correct and that it exists in the database. The "Invalid object name" error usually occurs when the table name is incorrect or the table does not exist in the database.
    3. Check if the user has the necessary permissions to access the table. The user must have the SELECT permission on the table to read data from it. You can grant the SELECT permission to the user by executing the following command in SSMS:
    GRANT SELECT ON <table_name> TO <user_name>
    
    1. Check if the table is an External Table or a View table. If the table is an External Table, you need to ensure that the data source is configured correctly. You can refer to the following documentation for more information on how to create and configure External Tables in Azure Synapse Analytics:
    2. Check if the table is an External Table or a View table. If the table is an External Table, you need to ensure that the data source is configured correctly. You can refer to the following documentation for more information on how to create and configure External Tables in Azure Synapse Analytics:

    Use external tables with Synapse SQL

    I hope this helps! Kindly accept the answer if it's helpful to you. Thankyou

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.