SQL Server – Import Flat File using SSMS

Hello Friends,

Microsoft added lots of new features in SQL Server Management Studio to make it more helpful tool. One more feature “Import Flat File…” option has been added by Microsoft in SSMS 17.3. By using this GUI feature we can import flat files data in SQL Server. This feature is more powerful as compare to “Import Data From flat file” option. You can download latest version of SQL Server Management Studio by click here.

For using this feature, you just have to right click on the database in which you want to import data using flat file. Then go to Tasks and then click on “Import Flat File…” option as shown below.

Import Flat File in SSMS 1

This will open up Import Flat File wizard. Here first page is Introduction Page where we can get some introductory details about this feature. If you don’t want to see this page next time, just check the Do not show this page again. Now click Next button to proceed.

Import Flat File in SSMS 2

After click on next, you will get specify input file page. Here you can specify input file by using browse button. By default table name will be same as file name. if you want, you can change table name here. Finally you can also specify the schema name, under which new table will be created for imported data.

Import Flat File in SSMS 3

After specifying this entire information, click on next. Then you will get preview page under this “Import Flat File…” wizard.

Import Flat File in SSMS 4

After click on next, you will get Modify Column page. Here you can change any column name, data type of column, specify primary key and allow nulls setting.

   

Import Flat File in SSMS 5

After making all required changes then click on next. Now you will be on Summary Page.

Import Flat File in SSMS 6

If everything is specified properly for all previous steps then click on Next to execute the import. After execution of import, you will be on result page. During execution, you will see “In Progress” status.

Import Flat File in SSMS 7

After completion, you will see result as Success or Failure.

Import Flat File in SSMS 8

Now click on close. Now you can check imported data in SQL Server using T-SQL select statement.

Import Flat File in SSMS 9

Note: By using this feature, you can import data from two type of flat files only i.e. text and csv.

HAPPY LEARNING!

Regards:
Prince Kumar Rastogi

Follow Prince Rastogi on Twitter | Follow Prince Rastogi on FaceBook

   

About Prince Rastogi

Prince Rastogi is working as Database Administrator at Elephant Insurance, Richmond. He is having more than 8 years of experience and worked in ERP Domain, Wealth Management Domain. Currently he is working in Insurance domain. In the starting of his career he was working on SQL Server, Internet Information Server and Visual Source Safe. He is post graduate in Computer Science. Prince is ITIL certified professional. Prince likes to explore technical things for Database World and Writing Blogs. He is Technical Editor and Blogger at SQLServerGeeks.com. He is a regular speaker at DataPlatformDay events in Delhi NCR. He has also presented some in depth sessions about SQL Server in SQL Server Conferences in Bangalore.

View all posts by Prince Rastogi →

Leave a Reply

Your email address will not be published.