Good Morning...I realize this should be a simple correction but I am at home sick today on all kinds of meds...work called and wants me to export 60K+ rows of data.
One field in the table is 'text' datatype and everytime I execute the query I get
Msg 8152, Level 16, State 4, Line 4 String or binary data would be truncated.
I attempted to do a select into and it failed as well...can anyone help with this quickly.
asked Nov 23, 2009 at 01:06 PM in Default
Does the query fail when you exclude the 'text' field?
Edit following on from comment:
REPLACE works with varchar and nvarchar, so yes attempting to convert your long text field to this could result in that error.
What version of SQL are you using?
can you convert the field to
Edit: Replacing QUOTENAME
or if you still have issues with
Just to add to this, if you were using QUOTENAME to handle quotes in the string, then you have a couple of options.
replace the double quotes with nothing
or replace them with double quotes
it depends on how you need the output
That usually happens if the destination table's column is too short for the source data column (eg destcolumn char(10) <--- sourceColumn char(20)). Try to make sure source is wider or the same data length.
answered Nov 23, 2009 at 01:46 PM