Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Import data from flat file

Author  Topic 

kpsqlteam
Starting Member

6 Posts

Posted - 2012-11-28 : 03:48:50
Hi I have data in flat file like in below format
100purus01 naidu2505 amt01
101XXXX02 naidu2505 amt01 eeeee rrrrr yyyy

How can i insert this data into table using SQL server.
very urgent.

Thanks
Purush

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2012-11-28 : 04:17:21
You can import data in 3 ways.

1) Using BULK INSERT
2) By using Import/Export Wizard
3) By using SSIS packages ---------->Follow this link: http://blog.sqlauthority.com/2011/05/12/sql-server-import-csv-file-into-database-table-using-ssis/
Select Flat File Source from Data flow Sources


--
Chandu
Go to Top of Page

srimami
Posting Yak Master

160 Posts

Posted - 2012-11-28 : 06:22:10
Just to add one additional point to the above. By default, whenever you use Bulk Insert or Import/Export the datatypes will be of varchar. Make sure you use conversion factor or insert the data to another table with desired datatypes once loading is done from flat file.
Go to Top of Page
   

- Advertisement -