Querying Custom Data Columns in SQL

Entity Custom Data is stored in JSON format. There is no simple method to parse this data using pure SQL.

SELECT
[Id]
--,[EntityTypeId]
,[Name]
,[CustomData]
--,[Notes]
--,[AccountId]
--,[WarehouseId]
--,[LastUpdateTime]
--,[SearchString]
FROM [Entities]
WHERE [EntityTypeId] IN (SELECT [Id] FROM [EntityTypes] WHERE [Name] = 'Customers')
ORDER BY [Name]

You have a few options:


Using Stored Proc (function library)

Using V5 methods

… nothing to say here yet. If you upgrade to V5, we can go into more detail