|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
using bcp.exe
I have database: au12
in this database I have table: au_log and in the table field: logfile type image I want to load file c:\temp\test.rar with bcp.exe username: sa Can anyone write me how it to do? |
|
#2
|
|||
|
|||
|
using bcp.exe
Hello,
With image or text data that contains embedded control characters such as \t or \n you must be careful. 1) Either bcp out in the native format (-n): bcp.exe au12au_log out c:\temp\test.rar -Usa -P -n -T 123456789 (123456789 is the maximum size of the text/image column in your table + a little extra The default maximum text/image size will be 32768. Anything larger will be truncated unless you use the "-T" parameter). NTE: Files copied out in the native format (-n) can only be used on the platform they were created. Don't try to take a native bcp file created on Windows and use it on Solaris. 2) If you want the data in a character format (-c) you can use the following command but you must specify row & column terminators that you are sure are not in your data: bcp.exe au12au_log out c:\temp\test.rar -Usa -P -c -T 123456789 - t "^%^%" -r "$~$~" If you do not specify "-t" and "-r" the default row terminator is "\r \n" (on Windows) and the default column terminator is \t. So if your text/image data also has these characters bcp will become very confused. Thanks, Neal p.s. You can type the following command to find the maximum text length of your column to help you decide what a good value for "-T" might be: select max(datalength(logfile)) from au12au_log |
![]() |
| Viewing: Web Development Archives > FAQs > Databases > using bcp.exe |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|