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

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

SQL query used by navision

(0) ShareShare
ReportReport
Posted on by

Dear All,

I need to know about which SQL queries mostly used for navision to solved by problem regarding table and pages.

*This post is locked for comments

I have the same question (0)
  • Zaid Tariq Profile Picture
    2,274 on at
    RE: SQL query used by navision

    Hi,

    You mean the common queries used to solve common problems of NAV? Would be great if you can point out a specific problem.

  • Community Member Profile Picture
    on at
    RE: SQL query used by navision

    yes , provide all common sql queries name to solve common problem of NAV

  • Verified answer
    Zaid Tariq Profile Picture
    2,274 on at
    RE: SQL query used by navision

    Tip:

    - To delete the partner range table you can delete them from the dbo.object table

    - To remove all the permissions from a NAV database you can use these commands:

    delete from [dbo].[User]
    delete from [dbo].[Access Control]
    delete from [dbo].[User Property]
    delete from [dbo].[Page Data Personalization]
    delete from [dbo].[User Default Style Sheet]
    delete from [dbo].[User Metadata]
    delete from [dbo].[User Personalization]
    DELETE FROM [dbo].[Windows Login]
    DELETE FROM [dbo].[Windows Access Control]

    Will share more with you if found. Thanks

  • Suggested answer
    Suresh Kulla Profile Picture
    50,233 Super User 2025 Season 2 on at
    RE: SQL query used by navision

    What problems are you referring ? Give some examples ? and why do you need SQL Queries ? Mostly all of the issues need to be solved by making changes in NAV but not running SQL queries.

  • Community Member Profile Picture
    on at
    RE: SQL query used by navision

    provide, which Sql queries used by professionals to handle the NAV despite of delete.

  • ManishS Profile Picture
    86 on at
    RE: SQL query used by navision

    SQL is not the common problem solver for NAV. It is the background which stores data, for some specific issues you need to go to SQL.

  • Ruben.Mejia87 Profile Picture
    166 on at
    RE: SQL query used by navision

    Hello,

    The most common, is the one pointed by Zaid Tariq, and it is mostly used to grant access to any database when, for instance, you want to restore a customer's database on a local consultant's PC, then, as normally the customer´s db will have permissions for certain users, then, if you do not perform that deletion, you will not be able to even create a Server Instance in order to connect to the db with the application.

    However, I might say that for that purpose I use the foloowing:

    USE [DatabaseName];

    TRUNCATE TABLE "User Personalization";

    TRUNCATE TABLE "User Property";

    TRUNCATE TABLE "Access Control";

    TRUNCATE TABLE "User";

    GO

    And, as others has said on previous answers, to use SQL to solve problems is no the recommended way, but it is a great way of review the data. Or, depending on your needs, update some of it. I have use it very carefuly and with success to work on filling related tables, lists, charts, and so on. But never, NEVER, use it to modify records that were posted, or that just can be posted in the application using a process, because, this will cause several problems and malfunctions to your database.

    Anyway, If you need to review, copy, analyze, or even update any information, I share with you this site, where I found and use many SQL commands, with good examples of how-to-use.

    https://www.w3schools.com/sql/default.asp

    Hope the information be useful.

    Regards.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans