SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SQL Server and T-SQL Development Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




download SQL Server 2016
download SQL Server 2014
download SQL Server 2012



Upload Text File to SQL Server Database Table

Recently I did upload a password list stored in text file to SQL Server database table. I used SQL Server Bulk Insert command to insert text data into sql table as rows. Since the data structure in the text file was simple, just containing a password string on each line, the SQL Bulk Insert command was also simple.

In this SQL tutorial, you can find how to upload simple text file data into SQL Server database table using Bulk Insert statement.

I download top 10000 most common passwords list and upload this most frequently used passwords list to my SQL Server development database to use for password generator tool and password strength check tool that I'm developing in SQL.

Following SQL code is part of the SQL script that I use to upload password list text file data into SQL Server database table. I use SQL Server BULK INSERT command to import text file data to SQL table.

First I create a SQL database table CommonPasswordsList which will be populated with data imported from text file.
Then I execute BULK Insert command with target sql table and path of the source text file.

create table CommonPasswordsList ([password] nvarchar(max))

BULK INSERT CommonPasswordsList FROM 'c:\passwordlist.txt'

Above code is successfully executed to insert 10 thousand passwords read from text file into SQL Server database table.

SQL Server Bulk Insert command to import data from text file to database table







Related SQL Resources

SQL Server Articles

SQL Server 2012

SQL Server Tools

SQL Blog

SQL Server 2008 Blog

Certification Exams Blog

Reporting Services Blog

Analysis Services Blog

MS SQL Server Forums







Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems