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
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Errors using the bcp

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-02-22 : 07:41:04
shtjasows writes "when I want to insert to a table (sql server 2000) from a xls file,there is a error:

SQLState = 22001, NativeError = 0

Error = [Microsoft][ODBC SQL Server Driver] string data£¬right truncation

and my codes :

exec master..xp_cmdshell'bcp bluepages..Lanji in e:\dd.xls -c -Usa -P000000'

who may help me and tell me why or how to do ?
thanks"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2005-02-22 : 07:41:55
bcp does not work with native Excel files, it only works with text files (CSV, tab-delimited). You can either save your Excel sheet to one of these formats and use bcp on it, or use DTS to import from Excel directly.
Go to Top of Page
   

- Advertisement -