I need to create stored procedure or query or any thing on SQL server 2012 take datatable from csharp and divide data to multi sheet inside Excel File xlsx created .
Create File ABC.xlsx with two sheet first sheet name source and second sheet name types based on module and load data related to every sheet based on data related to every sheet .
so if i have two modules meaning I have two sheet .
public static DataTable GetData()
{
DataTable dataTable = new DataTable();
dataTable.Columns.Add("PartId", typeof(int));
dataTable.Columns.Add("Company", typeof(string));
dataTable.Columns.Add("Files", typeof(string));
dataTable.Columns.Add("Tab", typeof(string));
dataTable.Columns.Add("Module", typeof(int));
dataTable.Rows.Add(1222,"micro","Abc","source",1);
dataTable.Rows.Add(1321, "silicon", "Abc", "Types", 3);
dataTable.Rows.Add(1444, "cd2", "AutoD", "Rev", 10);
dataTable.Rows.Add(1321, "cd3", "AutoD", "source", 11);
dataTable.Rows.Add(1541,"mtvscro", "AutoD", "Rev", 12);
dataTable.Rows.Add(9811, "tvs2", "Mog", "Dal", 6);
dataTable.Rows.Add(1901, "tvs3", "Mog", "Mondo", 6);
dataTable.Rows.Add(2111, "toyo", "Mog", "Pingo", 7);
return dataTable;
}
are SQL server 2012 can divide data on excel file to multi sheet or not ?
I can do that by csharp but from SQL cannot
so How can I achieve that from SQL server 2012 by any way ?