Copying data from Navision 4.0 to SQL Server 2005

Hello! I’m new to Navision and a new DBA, so please forgive me if this is a silly question. Is it possible to copy the data tables from Navision 4.0 to SQL 2005 without copying the Code Units? I am trying to set up a secondary test environment. Thanks in advance!

I think you are mixing concepts. Codeunits is a place where business logic code is located. If you want to create a test environment why just do backup and restore procedure?

Thank you for your reply Nuno. I went back to the our resident Dynamics developer for clarification. It is my understanding that forms and reports are embedded in the SQL tables. Is there a way to copy data to our test environment while preserving any form or report changes in progress? Again, I apologize if these are silly questions.

The best and most easy way is to copy the whole SQL database.

We always have a training and a user-acceptance-test database, which all are a copy off our production database and updated every time the production database is updated (updated with new objects not data).

I don’t exactly remember what blog I saw it on, but maybe some of the other members remember that, but there is a smart way you can make the database automatically display what database you’re logged into.

You can restore a full SQL Server backup of the production database on a test server, and it will be available to the NAV client. I would personally rename the company right away though, and restrict access to the bare minimum, to prevent confusion.

All NAV objects are stored in the Object table by the way, including table designs.

Yes Daniel, if possible, then renaming the company name is a good idea. I remember a few years back in my previous job, we didn’t rename the company names (we had about 30 companies in the database so it would take “forever” in SQL). After they went live, they were actually using the company in the training database instead of the one in the production database. It took 2 weeks before we noticed that!

If renaming the company then at least changing the name in the “Company Information” table could be recommended - this way at least most of the reports would print the right name.

But adding the “warning form” as suggested in this blog (which I still have forgetten which one it is) is a very very good idea to implement. Until I found this blog post, we were actually just adding a line to the menu suite saying “TRAINING” or “UA TEST”.