Is there any Easy way to copy CSV to SQL Server using C#
Hi Experts ,
Lot of Internet solutions are trying to create a Data table first and map the column SQL bulk instances and try to import the CSV . What if i have 30 to 40 columns . Do i need to all those columns in data table and SQL bulk copy Instances. Is there any other easy way on this
Microsoft SQL ServerMicrosoft SQL Server 2005C#ASP.NET
Last Comment
karthik80c
8/22/2022 - Mon
Vitor Montalvão
You don't need to reinvent the wheel. SQL Server has a bulk copy utility called BCP. It's an .exe file so it can be called from a C# program. Check the examples in the link, they are with .csv.
Or you can execute BULK INSERT command from the database. There's also a .csv example from the link.
Or you can execute BULK INSERT command from the database. There's also a .csv example from the link.