Is it possible to insert data from another database to NAV created tables thru backend, I mean thru SQL level?
*This post is locked for comments
Is it possible to insert data from another database to NAV created tables thru backend, I mean thru SQL level?
*This post is locked for comments
Best practice are "don't do any operation in SQL"; but you can access SQL data source by codeunit (I hav a SQL Utility CodeUnit for that purpose) using net objs, then do read data from NAV CU and insert data in your instance with NAV C/AL functions.
This approach allows non only nav triggering, but also the defautl values for every field in your NAV tabel record (NAV instance crashes with nulls).
B/R
Please tell us specifically what you need to do. What is the end result you are trying to achieve?
hi,
IS NOT best practice (.Microsoft suggest to use Rapidstart Services, XML ports or exposed Web Services to import\export data) ... but you can use a sql "SELECT INTO STATEMENT" to do this (can be useful for fast demo scenarios etc. and you can schedule..)
look at this link:
NAV to NAV SQL Fast Data Migration (with dynamic “INSERT INTO” STATEMENT)
or on my MSDN Page
gallery.technet.microsoft.com/NAV-to-NAV-SQL-Fast-Data-4341b7e9
Hi,
May I know what exactly you are trying to do.
Insert data from NAV Tables from other NAV instance? or Insert data from any linked Servers ?
Are those the custom tables or base tables?
If it is for any custom table from Linked Servers it is very simple, you can use Linked Objects property of the NAV tables. Check the below links. (never insert from back-end as it will bypass all the validations)
http://dynamicsuser.net/blogs/waldo/archive/2008/11/08/how-to-display-an-sql-server-view-in-microsoft-dynamics-nav.aspx
https://msdn.microsoft.com/en-us/library/dd338982.aspx
http://forum.mibuso.com/discussion/30778/linked-object-and-sql-view
Hope this will help.
Simple answer is Yes. You can insert data to NAV through direct SQL. However the concern is, is that the correct practice go forward.
When you insert data into NAV tables directly through SQL, NAV will not check any data validation or fire any trigger codes written in the table level. Therefore this is very risky and not recommended to proceed.
What you can do is create some temp tables in NAV database and then push your data those tables. Once the data transfer is completed you can create a C/AL codes for the data integration to original NAV tables. This will fire the triggers in NAV and you will have no issues.
inserting/modifying data on sql level is in case of nav no good idea, because the according triggers on nav level are not run and the data integrity gets lost. so, better use web services to insert data. the nav source database provides a webservice (published codeunit, ...), which is consumed by nav target database.
André Arnaud de Cal...
292,494
Super User 2025 Season 1
Martin Dráb
231,305
Most Valuable Professional
nmaenpaa
101,156