Inserting CF Arrays/Structures/Queries in SQL Server
Copy link to clipboard
Copied
Hi there
For one reason or another, I am looking for a way to insert (and extract at a later time) a cfquery, Struct Object and/or an Array in SQL Server.
That is to say, I am trying to insert the entire object in one column of one row, rather than the rows or elements of the cfquery/Struct/Array in separate rows of a SQL Server table.
Does anyone know if this is possible?
Thank you for your assistance in advance.
Regards
Boon
Copy link to clipboard
Copied
You'll need to serialize the cfquery/struct/array object before saving
to the database and deserialize when extracting from the database. If
you're on CF7 then take a look at cfwddx, if you're on CF8 you can use
serializeJSON or cfwddx (I would recommend serializeJSON because the
length of the generated serialization is smaller).
Mack
Copy link to clipboard
Copied
Thanks for this Mack, I'll check it out.
Regards
Boon

