Solved

using openquery to update AS400 table

Posted on 2002-05-22
5
946 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

821 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