Link to home
Start Free TrialLog in
Avatar of Swamp_Thing
Swamp_ThingFlag 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?
Avatar of ste5an
Flag of Germany image

Why not using the DATETIME value directly, instead of you manual conversion?
Avatar of Gary Patterson, CISSP
Gary Patterson, CISSP
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Swamp_Thing, do you still need help with this question?