Tagged: SQL objects
- March 19, 2016 at 10:07 am #36756
Could you please guide me where to find information about how can I use SQL Server Express 2012 to store PowerShell objects?
Until now I use the instructions of the book "Learn PowerShell Toolmaking in a Month of Lunches" that simply connect to a database and store information in tables.
I want to go one step forward and learn how to store PowerShell objects as SQL objects.
Is there any module or script for this to be done?
Or any advise?
Thanks in advance
CVMarch 19, 2016 at 11:25 am #36760
What Objects are you looking to save in SQL?
Are you reffering to XML structure or JSON ?
If others, why would you want to flatten objects into 2D tables ?
I can understand saving data to SQL and having a ps script query the data and do something with it.But then its data, not PS objects. Remember that a DB table isnt always the best sotrage for all operations, sometimes a text file / ini file would be easier.March 19, 2016 at 11:57 am #36761
Thank you for the quick reply.
I need to store custom objects that will contain basically some string and datetime properties.
In fact you helped me by referring to XML or JSON.
Is it possible to store json in SQL server 2012 db?
Furthermore it is mandatory to use SQL server (referring to the alternative way of storing data).
ThanksMarch 19, 2016 at 1:16 pm #36765
You can store any info you want in SQL, the structre is not "important". You can store pictures for that matter
that said, SQL2012 supports XML as a native datatype, so you can have a table with a column that is an XML document. As it's natively supported it means you can even do a select statement to find a specif value down the tree on the SQL itself, without needing to send the XML to the client and let it parse it.
In SQL 2016 JSON will be supported "almost" nativelyMarch 19, 2016 at 1:41 pm #36767
Thank you again for the reply.
Honestly you helped me a lot.
Now it only remains to make some tests.
You must be logged in to reply to this topic.