Avatar of Swamp_Thing
Swamp_Thing
Flag for United States of America asked on

MS/SQL OpenQuery to linked DB2 Server error

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
DB2Microsoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Vitor Montalvão

8/22/2022 - Mon
ste5an

Why not using the DATETIME value directly, instead of you manual conversion?
ASKER CERTIFIED SOLUTION
Gary Patterson, CISSP

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Vitor Montalvão

Swamp_Thing, do you still need help with this question?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy