Copy a table from the Access database to the SQL database on a regular basis every day (excerpt)

Source: Internet
Author: User

How to implement the following functions:
Copy a table from the Access database to the SQL database on a regular basis every day.
The fields in the two tables are not exactly the same (name in access and name in SQL)
What's more, you can only copy qualified data (for example, only copy the list of students who have graduated )?

Step 1: Create a linked server.
Enterprise Manager -- Security -- Link server -- Right-click -- create link Server
Create a linked server to connect to the Access database, assuming the name is aa

Step 2: Start the SQL Agent service and set it to auto start

Step 3: Set the synchronized job
Enterprise Manager -- manage -- SQL Agent agent -- job -- Right-click -- create job
Enter the job name in general
Click new in the step, enter the step name, select tsql script as the type, and enter your update command in the command:

Insert into the database you want to update. DOB. the table you want to update (field Name List)
Select field name list from the table A, Aa... access table name to be updated
Where condition

OK.

In scheduling, how do you schedule your updates.

After confirmation, we are done.

Note: The SQL Agent agent service must be started. Otherwise, your job will not be executed.
The table that references access is linked to the server name...
There is no difference between other operations and local tables.

You can also use OpenRowSet () to open a specified table in access without creating a linked server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.