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.
Author |
Topic |
mohinsoft
Starting Member
7 Posts |
Posted - 2008-03-28 : 12:10:07
|
hi my friendsi want read data from text file,and write to my table in sql,please help meM.O.H.I.N |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-28 : 12:31:55
|
You can use bcp, bulk insert, or DTS/SSIS.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
mohinsoft
Starting Member
7 Posts |
Posted - 2008-03-28 : 12:43:57
|
thans my friend but i want write code to T-sqlwhat is source code?i use code :insert into mytableinsql select * from OPENROWSET ('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\myfile.xls;', 'SELECT * FROM [mysheet$]')for excel to sqlbud i dont know for text fileplease help me....thanksM.O.H.I.N |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-03-28 : 15:20:24
|
BULK INSERT is a T-SQL command.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
mohinsoft
Starting Member
7 Posts |
Posted - 2008-03-30 : 12:10:38
|
thanks my dear friendcan you help me more?or put sample code?Tnx 4 uM.O.H.I.N |
 |
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-03-30 : 12:22:10
|
You can do with Import/Export wizard. How big is the data? |
 |
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-03-30 : 13:09:43
|
the BOL = books online = sql server help has example on the use of bulk insert.also google has tons of examples._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
 |
|
|
|
|