Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m frustrated

sp_prepare failing with Error 13005

I have an application that generates a prepared statement for processing data. This is the prepared statement that is being generated for the Contact object and fails:
declare @p1 int
set @p1=1
exec sp_prepare @p1 output,N'@P1 nchar(108)',N'SELECT C.AccountID, C.ID
FROM SALESFORCE...Contact C
WHERE (AccountID = @P1 )',1
select @p1

Using SQL Profiler, I am getting these Error Messages:
OLE DB provider "DBAmp.DBAmp" for linked server "SALESFORCE" returned message "Error 13005 : expecting ''''', found 'EOF'".
Error: 7320, Severity: 16, State: 2
Cannot execute the query "SELECT "Tbl1001"."AccountId" "Col1003","Tbl1001"."Id" "Col1004" FROM "Contact" "Tbl1001" WHERE "Tbl1001"."AccountId"=?" against OLE DB provider "DBAmp.DBAmp" for linked server "SALESFORCE".

The similar Account Prepared Statement is working:
declare @p1 int
set @p1=1
exec sp_prepare @p1 output,N'@P1 nvarchar(39)',N'SELECT Member_ID__c, A.ID AS AccountID
FROM SALESFORCE...Account A
WHERE (Member_ID__c = @P1 )',1
select @p1

Any ideas on what may be causing this?
1 person has
this problem
+1
Reply