Data Export from Nav Sql DB to an external Sql DB??

Simo_baSimo_ba Member Posts: 78
edited 2009-03-19 in SQL General
Hi Guys,

I need to export some Tables from NAV to an external SQL DB (I'm using SQL Server 2005)

For Example : I want to Export Sales Header and Sales Line for Customer wich are Blocked=False;

What's the best way to solve this issue?

My Job should be scheduled.

Any suggestions
Thanks

Comments

  • ara3nara3n Member Posts: 9,256
    Write a sql statement

    The sql statement will look something like this.
    Insert   [field names of other database]
    
    into sqlserver.database.tablename 
    (  Select  [field Names from Sales header]
      from  CompanyName$SalesHeader , CompanyName$Customer
      where Customer.Blocked <> 0)
    
    


    And schedule it to run from SQL agent.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • Simo_baSimo_ba Member Posts: 78
    Hi Rashed,

    Is thers any tool that will hepl me with this issue as SSIS DTS or Replication,

    cause I have a lot of table to do

    Thank you
  • garakgarak Member Posts: 3,263
    Yes you can use SSIS Packages for this or replication.

    But on all (SSIS,Replication,Agentjob) you must define:

    1. the source (Database/table)
    2. destination (Database/table)
    3. Filters

    So with the SSIS Designer you can define this. Is it this what you need or a other tool?
    Do you make it right, it works too!
  • Simo_baSimo_ba Member Posts: 78
    Thanks garak,

    I think SSIs will be the best tool, here is my scenario.

    Let say i have SourceDB and DestDB ok,
    1. I want to (Select * Form SourceDB.Table Where condition) View1
    2. Transfer my Records to DestDB.Table
    3. Update SourcDB to flag the record as alreay transfered to avoid to transfer them twice.
    4. schedule the pakage to run every 5min ex.

    Thanks a lot
  • garakgarak Member Posts: 3,263
    Use SSIS for this. For scheduling use the SQLAgent that run the SSIS package for example every 5 minutes.
    i use the same on a customer with an offline POS system.
    Do you make it right, it works too!
Sign In or Register to comment.