I'm hoping there's just something I'm overlooking..
I'm using RTRIM and LTRIM to make sure no extra spaces in the original text make its way into the final table.
So my query (the part creating the huge field) is:
And when I pull the data, the longest individual value in a given record in this field is 30 characters long.
So why in the world is SQL (when using SELECT INTO) slapping a varchar(8000) on the field???
What brought me to this to begin with was I was creating the table, and inserting into it. But it kept giving me the "data will be truncated" message and quitting. So when I used SELECT INTO, I got a varchar of 8000 characters for the size.. though not a single value fits that size????
Any thoughts? Is it b/c of the original value?
I looked at the table the value is coming from, and it's a varchar(255), b/c was imported from a text file, I think.
Thanks for any thoughts or suggestions.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
I'm using RTRIM and LTRIM to make sure no extra spaces in the original text make its way into the final table.
So my query (the part creating the huge field) is:
Code:
SELECT LTRIM(RTRIM(REPLACE(a.[BusinessName],'OldName','NewName'))) as BusinessName
FROM MyTable a
And when I pull the data, the longest individual value in a given record in this field is 30 characters long.
So why in the world is SQL (when using SELECT INTO) slapping a varchar(8000) on the field???
What brought me to this to begin with was I was creating the table, and inserting into it. But it kept giving me the "data will be truncated" message and quitting. So when I used SELECT INTO, I got a varchar of 8000 characters for the size.. though not a single value fits that size????
Any thoughts? Is it b/c of the original value?
I looked at the table the value is coming from, and it's a varchar(255), b/c was imported from a text file, I think.
Thanks for any thoughts or suggestions.
"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57