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
 General SQL Server Forums
 New to SQL Server Programming
 import a text file in sqlserver

Author  Topic 

marclas
Starting Member

16 Posts

Posted - 2012-05-10 : 02:58:48
hi,
is it possible to import a text file in sql server?
in fact i have a list of data in a text format that i wanted to add to a table in my sqlserver.
how can i do it?

As in Access where you can import data is that possible with sqlserver?

Marclas

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-05-10 : 03:01:54
http://technet.microsoft.com/en-us/sqlserver/Video/dd941934
http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-05-10 : 08:10:48
You can also use import/export wizard

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vijays3
Constraint Violating Yak Guru

354 Posts

Posted - 2012-05-10 : 18:43:00
Using following way you can do that

1.SSIS package
2.Import and Export wizard
3. BCP
4.Bulk Insert eg:


BULK INSERT MyTable from 'C:\Data\Vijay.txt'
with (
rowterminator ='\n',
fieldterminator =',\',
datafiletype ='char')
Go to Top of Page
   

- Advertisement -