SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 bcp causes error when running script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

dunsta
Starting Member

1 Posts

Posted - 02/20/2012 :  01:12:17  Show Profile  Reply with Quote
Hi,

I have a script that loads all data from the backup to the Database.
When running the script I get to the problem table,

The script reads that there are 3325 records, the outputs this error 10 times :
Error = [Microsoft][SQL Server Native Client 10.0] String data, right trunction SQLState = 2201, Native error = 0

*10

after that error outputs 10 times, I get this error once

SQLState = s1000, NativeError = 0
Error = [Microsoft][SQL Server Native Client 10.0] Text Column data incomplete


Then, the next line of output is

43 rows copied

All of the other tables copy the correct amount of records.

The bcp line of code is :

bcp %DEST_DB%.dbo.%TABLE% in tempdump ^
-U %DEST_USER% ^
-P %DEST_PASS% ^
-S %DEST_SERVER% ^
-w
IF ERRORLEVEL 1 (
ECHO An error has occured when loading data to the %TABLE% table from %DEST_SERVER%/%DEST_DB% using the username %DEST_USER%.
ENDLOCAL
GOTO:EOF
)


However, after the errors I mention above, the 3 tables after the error table complete, therfore the line
GOTO:EOF in bcp is not being reached.

I think the field that is causing the errors is
content(nvarchar(max), null)

Thanks for any advice, if you need more information on the problem just ask for specifically what info you need (to be able to help me).

  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000