Skip to main content
Participating Frequently
July 6, 2009
Question

Inserting CF Arrays/Structures/Queries in SQL Server

  • July 6, 2009
  • 2 replies
  • 962 views

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

This topic has been closed for replies.

2 replies

Participating Frequently
July 7, 2009

Thanks for this Mack, I'll check it out.

Regards

Boon

Participating Frequently
July 7, 2009

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