SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Import data from flat file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kpsqlteam
Starting Member

6 Posts

Posted - 11/28/2012 :  03:48:50  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 11/28/2012 :  04:17:21  Show Profile  Reply with Quote
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 - 11/28/2012 :  06:22:10  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000