web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

Accessing tables of MS Dynamics NAVISION database

(0) ShareShare
ReportReport
Posted on by

Hie experts,

Firstly I would like to thank Jonathan and Tharanga for their help, I managed to establish connection to the database. I am using both the SQL Server Management and SQL Manager for SQL Server to view the structure of the database. Perfect.

The problem is : the table names have spaces between them for example PGN CORPORATE TEST$Check Counting List. Now when I want to refer to this table in my code i would put it this way: executeQuery("select Branch from dbo.PGN CORPORATE TEST$Check Counting List").  This is not working because its giving me an error. I com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near 'TEST$Check'. I have tried to put the table name in 'table name ' but it did not work. Please may you assists me as to how to get this working besides renaming the table(this would cause havoc I suppose).

I have tried one table that had one name; it worked perfect. I got all I wanted, but the ones with multiple words.

 

Forgive bad use of colors I was trying to distinguish the things.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    keoma Profile Picture
    32,729 on at

    hi again,

    use brackets to enclose the names, write following instead:

    executeQuery("select Branch from dbo.[PGN CORPORATE TEST]$[Check Counting List]").

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,118 on at

    Your SQl syntax is wrong.

    Use this

    executeQuery("select Branch from dbo.[PGN CORPORATE TEST$Check Counting List]")

    You need to give [ ] because you have special characters in the table name.

  • Verified answer
    Community Member Profile Picture
    on at

    hie,

    thanks brothers, it worked perfect. i just figured out that there are columns with multiple words. i put them in [ User ID] and it worked perfect.

    Thanks Jonathan and Tharanga.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans