Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store DataTable to SQL Server column

I'm trying to store a DataTable into a single column in a SQL Server table. The idea behind this is a user runs a SQL command and the returned output is stored into a datatable, then I want that datatable to be stored into a SQL Server logging table. Later on I want to be able to retrieve that entire datatable back for displaying on a logging aspx page.

Currently I'm just storing it as a big string but that doesn't give me column headers and the formatting is kinda funky as well as being inefficient.

TIA

like image 257
jclifford90 Avatar asked Sep 03 '26 00:09

jclifford90


1 Answers

I would probably convert the datatable to XML and store it into an XML field type if I was going to do what you are trying to do.

like image 87
E.J. Brennan Avatar answered Sep 04 '26 14:09

E.J. Brennan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!