I would like to store a c# object in SQL server. I thought about the following options:
- Read object byte memory stream and save them into the database (but not readable in sql)
- Json, readable, easy to convert but what data type? (only a datatype for sql 2016)
- XML, a bit less readable, easy to convert, there is an XML dataType
What's the best practice to store a C# object in a sql column and why? I am using SQL 2014, so I think option 3 is the best?
Edit: Note: it's not data to query, I just want to load a object which I have cached into a c# object in memory. And perform some logic on that in c#. It just takes a while to get the data from another database, therefore I save all my data in a custom object. Therefore I don't think I should use ORM
nvarchar(max)and done... XML is slower and takes much more space