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
Development resources, articles, tutorials, code samples, tools and downloads for ASP.Net, SQL Server, Reporting Services, T-SQL, Windows, AWS, SAP HANA and ABAP


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'
Code

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



SQL Server

SQL Server 2019 Installation
download SQL Server 2019
download SQL Server 2017
download SQL Server 2016
download SQL Server 2014
download SQL Server 2012
MacOS ve SQL Server 2019


Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.