Solved

using openquery to update AS400 table

Posted on 2002-05-22
5
941 Views
Last Modified: 2008-02-01
Is there a way to using openquery to update a specific record in AS400?

Or anyway using T-SQL to update an individual record in AS400?

Any help will be greatly appreciated.
0
Comment
Question by:shirlng
  • 3
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
johan_brohn earned 50 total points
ID: 7032330
You should be able to use OpenQuery and/or OpenRowset
to update the AS400 if you can access the AS400 with ODBC.
0
 
LVL 1

Author Comment

by:shirlng
ID: 7046978
how?
Any Code you can provide to help?
0
 
LVL 1

Expert Comment

by:johan_brohn
ID: 7047127
Step 1.
Create an ODBC System DSN for the AS 400 on your machine.
U must have the ODBC drivers installed.

Step2.
Add linked server. Choose 'OLE DB Provider for ODBC' and
enter the default database name in the 'Catalog:' field.
Enter the name of the DSN in the 'Data source field:'.

Select the Security tab for the linked server and check the lowest radio button ('be made using ....') and enter username and password.

Step 3.
Test the linked server.

Step 4
UPDATE OPENQUERY(NameOfLinkedServer,
'SELECT Field FROM DB.Schema.Table')
SET FIELD = Value

OR JUST USE

UPDATE NameOfLinkedServer.DB.Schema.Table
SET FIELD = Value
0
 
LVL 1

Expert Comment

by:johan_brohn
ID: 7047137
0
 
LVL 1

Author Comment

by:shirlng
ID: 7074144
thanks so mucn, sorry for the delay.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
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.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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.

773 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