Solved

Creating a Script to schedule a data dump from SQL Server 2005 to Access

Posted on 2009-04-15
4
537 Views
Last Modified: 2012-05-06
Hi there,
I have a db in SQL Server 2005 and would like to dump all the data from one table on to an Access db on the same computer. This job would be running twice, @ 8 AM/PM. What would be the best procedure to do this? Create a Job? Package in SSIS? I'm not that familiar with SSIS...
Also, the destination table has different field names than the source table, so mapping would probably come into play.
I'm a little comfortable with the insert statement, it's the scripting from SQL Server to Access is what I'm having trouble with...

Thanks for your input,
Classic
0
Comment
Question by:Classic1
  • 2
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
RiteshShah earned 500 total points
ID: 24149486
you can create one linked server and create one job which will dump your data from SQL Server to linked access table. here is one example to create linked server with Access

http://www.sqlhub.com/2009/03/linked-server-in-sql-server-2005-from.html
0
 

Author Comment

by:Classic1
ID: 24150557
Hi there,
Thanks for the link, the sp_addlinkedserver worked well! I was able to execute a select statement within SQL...

Now is there a chance I can do an insert statement to the linked Access db? I tried doing this, but I got this error: (This was executed in the actual db, not in the master environment.

Msg 215, Level 16, State 1, Line 1
Parameters supplied for object 'AutoSolLink...AuditTrail' which is not a function. If the parameters are intended as a table hint, a WITH keyword is required.

I've attached the code as well..

Much appreciated,
Classic
Insert into [AutoSolLink]...AuditTrail ('Data1', 'Data2')

Select ADR.Reg_000, ADR.Reg_001

from MercuryAuditDRecords ADR

Open in new window

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24150652
run this

Insert into [AutoSolLink]...AuditTrail (Data1, Data2)

Select ADR.Reg_000, ADR.Reg_001

from MercuryAuditDRecords ADR

Open in new window

0
 

Author Closing Comment

by:Classic1
ID: 31570480
Thank you very much! I was able to insert the data successfully...much appreciated,
Classic
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now