How to move records from linked tables to native table automatically

  • Thread starter Thread starter D
  • Start date Start date
D

D

Hello everyone,
I'm looking to create a batch file or VB script of some sort
to copy the next date that has not already been imported and it's
corresponding data from a linked table (SQL using DSN) to a native
table to eliminate impact of reporting directly on the SQL server. Is
it possible to create a process to automate this Copy/Paste or Append
query task nightly around 4:30 am or so?
 
I'm looking to create a batch file or VB script of some sort
to copy the next date that has not already been imported and it's
corresponding data from a linked table (SQL using DSN) to a native
table

Without knowing anything about your table structures, I guess it's
something like this:


insert into MyTable (RecordDate)

select Max(RecordDate)+1
from OtherTable IN [SQLServer; "c:\data\mydsn.dsn"]
where Imported=False

I made up the connection string in the IN clause. In fact, if you've
already linked to the other table then you don't need the IN clause at all.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top