|
 |
asp_databases thread: script for loading a tab delimited file to sql server 6.5
Message #1 by "Eric Van Camp" <eric.vancamp@c...> on Wed, 13 Dec 2000 09:47:04 -0000
|
|
hi,
i want to load a tab delimited file to sql server 6.5, but i really do not
know how to do it, anyone any idea how i should start, where i can find
information on this item?
txs
eric
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by "Sid Downie" <sid.downie@b...> on Wed, 13 Dec 2000 15:58:06 -0000
|
|
Use the bulk copy (BCP) facility (from DOS *.bat commands). The tab
delimiter is \t (in the field terminator -t).
The syntax is "(BCP exe filepath)\bcp.exe (Databasename).(Tablename)in
(Filepath)\(otuputfilename) -c -t\t -r\n -S (Server) -U (Username)-P
(password)"
The "in" is for importing. Replace with "out" for exporting.
If you have trouble, replace the tab with another character (eg , or #)
and use -t ,(or -t #) instead of -t\t.
Any good Administrator's guide to SQL Server should get you there, but
find a 6.5 version, as I believe that with SQL Server 7 you do not need to
use the DOS environment.
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by "Eric Van Camp" <eric.vancamp@c...> on Wed, 13 Dec 2000 18:07:58 -0000
|
|
hi i ran the following script in dos command
"c:\mssql\binn\bcp.exe ameel.company IN
e:\ameel\datastore\klanten.txt -c -t\t -S milestone1 -U sa -P"
the database in which i want to load the text file is ameel, the table is
called company
the error i get is" copy direction must be eiter "in" or "out"
any suggestions of what i am doing wrong?
txs
eric
-----Original Message-----
From: Sid Downie [mailto:sid.downie@b...]
Sent: Wednesday, December 13, 2000 3:58 PM
To: ASP Databases
Subject: [asp_databases] Re: script for loading a tab delimited file to
sql server 6.5
Use the bulk copy (BCP) facility (from DOS *.bat commands). The tab
delimiter is \t (in the field terminator -t).
The syntax is "(BCP exe filepath)\bcp.exe (Databasename).(Tablename)in
(Filepath)\(otuputfilename) -c -t\t -r\n -S (Server) -U (Username)-P
(password)"
The "in" is for importing. Replace with "out" for exporting.
If you have trouble, replace the tab with another character (eg , or #)
and use -t ,(or -t #) instead of -t\t.
Any good Administrator's guide to SQL Server should get you there, but
find a 6.5 version, as I believe that with SQL Server 7 you do not need to
use the DOS environment.
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #4 by "John P. Parlato" <jparlato@m...> on Wed, 13 Dec 2000 22:32:58 -0500
|
|
the syntax of the bcp command has a direction in/or/out. it determines
whether you are writing to the file, out; or writing from the file to the
data base - in;
-----Original Message-----
From: Eric Van Camp [mailto:eric.vancamp@c...]
Sent: Wednesday, December 13, 2000 1:08 PM
To: ASP Databases
Subject: [asp_databases] Re: script for loading a tab delimited file to
sql server 6.5
hi i ran the following script in dos command
"c:\mssql\binn\bcp.exe ameel.company IN
e:\ameel\datastore\klanten.txt -c -t\t -S milestone1 -U sa -P"
the database in which i want to load the text file is ameel, the table is
called company
the error i get is" copy direction must be eiter "in" or "out"
any suggestions of what i am doing wrong?
txs
eric
-----Original Message-----
From: Sid Downie [mailto:sid.downie@b...]
Sent: Wednesday, December 13, 2000 3:58 PM
To: ASP Databases
Subject: [asp_databases] Re: script for loading a tab delimited file to
sql server 6.5
Use the bulk copy (BCP) facility (from DOS *.bat commands). The tab
delimiter is \t (in the field terminator -t).
The syntax is "(BCP exe filepath)\bcp.exe (Databasename).(Tablename)in
(Filepath)\(otuputfilename) -c -t\t -r\n -S (Server) -U (Username)-P
(password)"
The "in" is for importing. Replace with "out" for exporting.
If you have trouble, replace the tab with another character (eg , or #)
and use -t ,(or -t #) instead of -t\t.
Any good Administrator's guide to SQL Server should get you there, but
find a 6.5 version, as I believe that with SQL Server 7 you do not need to
use the DOS environment.
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
|
|
 |