3

I have an application that has MS SQL Server as the backend database, ColdFusion server and front end is Angular. I am getting the following error when trying to retrieve data from a few tables in the database. It doesn't impact all data but only a few tables

message=JSON serialization failure: Unable to serialize binary data to JSON

Code to serialize data:

<cfset responseString = serializeJSON( apiResponse.data )>

Any ideas how to resolve this issue?

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
sc09
  • 41
  • 6
  • Please format any error messages and code different from the rest of your text to make them easier to read for others. – Kay Aug 07 '18 at 19:54
  • 4
    The error message is pretty straight forward. You cannot serialize binary data to JSON. The data will need to be encoded first. See https://stackoverflow.com/q/1443158/1636917 – Miguel-F Aug 07 '18 at 20:21
  • @Miguel-F Your comment helped me approach the issue differently and find a solution – sc09 Aug 07 '18 at 21:03
  • 3
    Glad it helped you. Please post your solution as an answer to your question. It is okay to do that and will help others that have similar problems. – Miguel-F Aug 08 '18 at 12:32

1 Answers1

1

I was able to resolve the issue with Miguel's direction. The SQL Server database included a few tables which were migrated from another Access database and these tables included a column named SSMA_Timestamp. The value in this column was a binary one. I cleansed the database and queries to exclude this column and all worked fine.

Thanks to @Miguel-F for a quick response.

sc09
  • 41
  • 6