Developer forum

Forum » Integration » Error loading custom table with varbinary (blob) datatype in SQL Server

Error loading custom table with varbinary (blob) datatype in SQL Server

Byron Head
Reply

I created a data integration job to pull product image files from AX into a custom table in SQL Server. The source is XML and the destination is the DynamicWeb Provider. The custom table has three columns that correspond with the three columns in my source XML file (attached). The third field (ProductImage) is the varbinary (blob) field in the table. When running the data integration job I get the following error: Exception: Incorrect syntax near 'BIGINT'.. Failed executing following SQL-statement: if exists (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[_ProductImagesTempTableForBulkImport1]') AND type in (N'U')) drop table [dbo].[_ProductImagesTempTableForBulkImport1] create table [dbo].[_ProductImagesTempTableForBulkImport1] ([ProductNumber] nvarchar(255),[ProductName] nvarchar(255),[ProductImage] [AutoID] BIGINT IDENTITY (1, 1) NOT NULL). It looks like the job isn't able to handle the varbinary datatype and is incorrectly defining that as a BIGINT when writing to the temp table. I just need to know if there is a way to get this to work. Below is a screenshot of the entire error message for reference:


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Your source data isn't a binary. It's a base64 encoded version of a binary file. It comes out as plain text, so you can store it in a nvarchar(max) column and it should just work. Then at a later point (outside of integration) you can decode the base64 encoded string into an image again.

Hope this helps,

Imar

 

 

You must be logged in to post in the forum