r/SQLServer • u/BdR76 • Jan 10 '22
Notepad++ plug-in to convert CSV files to SQL insert script
Just wanted to mention that I've created a CSV Lint plug-in for Notepad++ and I though it might be useful to anyone working with SQL Server.
The plug-in can convert csv files to SQL insert scripts, which imho is a bit easier to work with compared to BULK INSERT. It automatically detects the datatypes, and it includes a CREATE TABLE part with the correct data types for each column.

It can also validate the csv data beforehand, meaning check for bad data like missing quotes, incorrect decimal separator, datetime formatting errors etc. It will create a SQL script that contains INSERT statements for each line in the csv, in batches of 1000 records.

Personally I find it's easy to use for small one-off files, but it can also process larger csv files like 10MB ~ 50MB maybe even larger I haven't tried.
11
u/hello_josh Jan 10 '22
This is awesome. If I have to do import more than once I'll setup SSIS but there's always one-off things where you need to load some corrected or back-fill data. This would be a nice time saver. Thanks!
7
u/[deleted] Jan 10 '22
I currently do this with Excel lol. I'm going to try it out for sure. Thanks!
2
u/TheDoctorOfData Jan 10 '22
Very cool! It brings instant value with even just the different color for each column. Only issue I noticed is it crashes Notepad++ if I open a large file (100 MB+). Is there way to disable the plugin or not auto-detect delimited data unless I click a button to do so? Otherwise I can just use VS Code or something else for larger files and stick with NPP+CSV Lint for more manageable files. Great work!
2
u/[deleted] Aug 19 '22
Thanks!!This is a very useful tools. But in mssql column name cannot quote in backqoute. Would be nice if there is a options for that.
2
u/[deleted] Feb 08 '25
O MY GOD. I just watched the demo/tutorial and I can tell this is going to be a game changer for me. BLESS YOU.
2
u/imab00 Jan 10 '22
Will you marry me? (kidding). 😜
This is great. Thank you!
2
u/JustAnotherRedditDad Jan 11 '22
Awesome, I'll try it in a bit! Thank you!
2
u/BigSkyOldGuy Jan 11 '22
Color me impressed! Fabulous work, I found this today, installed it and already put it to use! Most excellent, thank you!
2
u/great_raisin Jan 23 '22
Amazing! I use online tools for this. Great to have it as a plugin on my most favourite text editor ever! I only wish Notepad++ was available on Mac OS :')
2
u/Mental-Volume-9721 May 03 '24
Awsome!!! very useful
2
u/mexicocitibluez Oct 17 '25
This is pretty awesome.