Navision and SQL - Server

AlexEAlexE Member Posts: 8
Hallo

I use Navision 4.0

I use Navision 4.0 with Sql Server.

I want to get data from an other SQL Server Database (not Navision).
How can I programm an Record, from an SQL Server Table from an other SQL Server Database?

Thanks for your help

Comments

  • ara3nara3n Member Posts: 9,257
    I would create a new table in 50K range in Navision.
    From the other SQL Server database, I would write to this table.

    From Navision write code to do what You want to do with that data in 50K range.

    That would be the start. We can go in detail if you provide the details.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • kinekine Member Posts: 12,562
    There are two base ways:

    1) You can create view on your SQL server showing data from the linked server and you can create linked table in the Navision to see this view within Navision. After that, you will have access to the data through common C/AL code... (search for LinkedObject and learn how to use Linked servers in MS SQL Books Online)

    2) You can use ADO automation libraries to read the data from the server. (search this forum for some examples for "how to use ADO")
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • DenSterDenSter Member Posts: 8,307
    You can also create a view from your Navision database into the other database and create a linked table in Navision that links to your new view.
  • ara3nara3n Member Posts: 9,257
    if you create views, you have to take into consideration permission, and roles the user will need in order to see the view.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • DenSterDenSter Member Posts: 8,307
    Yes users will have to be db_owner in the other database to have write permissions in the view.
  • kinekine Member Posts: 12,562
    You do not need such a permissions if you create view on 1st server (viewing the data from the table) and if you create second view connected to this 1st view on the linked server. After that, you need only to setup permissions for the view on the Navision server. I remember that if you connect it in this way, the permissions are used differently...


    Table - > View <=(Linked Servers)=> View -> Navision LinkedObject
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.