I need to generate a TSQL script from a DataTable along with the DATA in it.
It\'s not a single insert. Beside that, I need the create the table too (same datatable structur
Take a look at: Generate SQL INSERT commands programmatically
Essentially, the code is looping through the DataTable.Columns collection to generate the column list of the INSERT statement. Then it loops through the values of the DataTable to create the parameters with values.