0

I am getting error SQL Errors occurred while processing retrieved data: Error converting data type varchar to bigint.

This my Query and its come from the where clause. Anyone help me to resolve this issue?

DECLARE @Inven VARCHAR(500)
SET @Inven = CONVERT(varchar,?)

SELECT count(tc.Name)
FROM Booking b
inner join BookingPassenger bp on bp.BookingID = b.BookingID
inner join PassengerJourneyLeg pjl on pjl.PassengerID = bp.PassengerID
WHERE il.InventoryLegID in (select value from STRING_SPLIT(@Inven, ','))

here ? will be = 12334,9899,343534

Thank you

4
  • 3
    This doesn't look like a Salesforce question, is it marketing cloud related?
    – Girbot
    Mar 24 at 9:28
  • Marketing Cloud is also Salesforce @Girbot ;-)
    – zuzannamj
    Mar 24 at 21:59
  • This is SQL QUERY in Boomi Mar 26 at 9:03
  • Issue in where clause WHERE il.InventoryLegID in (select value from STRING_SPLIT (?, ',')) here i am getting Error converting data type nvarchar to bigint Mar 26 at 9:32

2 Answers 2

1

Your query is failing because you are trying to store varchar data into a field which has Int/BigInt as a datatype. Do check your Data extension/ Table fields & their datatypes and the kind of values you wanted to store in those fields. Use functions like convert/format in your query to resolve the issue but do check the datatype first.

https://www.w3schools.com/sql/func_sqlserver_convert.asp https://www.w3schools.com/sql/func_sqlserver_format.asp

1
  • Thank you. As you said I converted the value to varchar Mar 27 at 13:24
1

You can only do SELECT statements in SFMC.

While the engine is based on Microsoft Transact-SQL, not all functions are supported:

https://help.salesforce.com/s/articleView?id=sf.mc_as_sql_reference.htm&type=5

It doesn't list all that's possible.

And there are some differences between what's supported in Query Studio and Query Activities.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .