5/20/2023 0 Comments Convert sql to csv![]() ![]() I dont want to make any transformation to the header. I know similar topics ( like this one) have been posted before - but I felt my question was unique enough for a new post. Im trying to export an entire table in my sql database and transform it into a CSV file with header. From what I understand, it is fairly easy to export/convert a dataset/result set to CSV using a stringbuilder. However, I was wondering, given that I have Epplus and the ability to save as Excel- is there not a cleaner way of doing it? Or is it best to take the data, use a stringbuilder for comma delimiting the values and use that for the CSV? I have found several links, such as this and this, which converts excel to CSV (however I can now skip this step, as I can just convert the resultset to CSV, with no need for the excel file), I also found this link. I have found several links, such as this and this, which converts excel to CSV (however I can now skip this step, as I can just convert the resultset to CSV, with no need for the excel file), I also found this link.įrom what I understand, it is fairly easy to export/convert a dataset/result set to CSV using a stringbuilder. However now, I need to save it as an CSV file. Now originally I was using the results combined with Epplus to save this as an Excel/Xlsl File - this worked perfectly/as intended. How to export data as CSV format from SQL Server using sqlcmd I want to generate CSV file using select query in SQL-server. ![]() I then have a controller that makes use of this service. I have a service that calls a stored procedure (using the Dbcontext) and places the results in an IList. Converting CSV to SQL is also possible in the phpMyAdmin software. I'm working in C# and need making use of Entity Framework 6. Csvsql is an example of a command-line tool that can generate SQL statements from a CSV file.
0 Comments
Leave a Reply. |