We help IT Professionals succeed at work.
Get Started

MS/SQL OpenQuery to linked DB2 Server error

356 Views
Last Modified: 2016-02-29
I have a SPROC that takes in parameters and uses OpenQuery to create a record in an AS400 DB2 table.   It works fine from my development server ( MS/SQL 2008 R2 ) but not from my production server ( MS/SQL 2008 R2 ).  The Linked Server to the AS400 is identical on both servers.  My production server returns this error:

A syntax error was detected at token ..  Token . is not a valid token.

The SPROC is attached.

I'm calling it as follows:

declare @result smallint
exec [dbo].[sprocAS400_Insert] 'VALUE1', 'VALUE-2', 'VALUE-0-3', 'VALUE4', 24, @result OUTPUT
select @result

above works fine but only from my test server.  The full error message ( also attached ) doesn't give me anything to go on - any suggestions?
sprocAS400_Insert.sql.txt
sprocError.txt
Comment
Watch Question
Expert for hire: IBM i, AIX, Linux, Windows, DB2, Performance, Security. EDI
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE