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.
| Author |
Topic |
|
rmuscarello
Starting Member
7 Posts |
Posted - 2002-06-03 : 10:05:41
|
| I'm trying to declare a variable as a varchar with a length > 255 and it's not expanding beyond that. I would like it to have a length of 8000. My question is why won't the field go to a length of 8000? This is how I'm try to declare the variable:DECLARE @email varchar(8000)SELECT @email='' select @email=@email+database.dbo.table.email+';'FROM database.dbo.tableThanks in advance!Roger |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2002-06-03 : 10:12:52
|
| What version of SQL Server are you using? SQL 6.5 and earlier only support a maximum of 255 characters for varchar. |
 |
|
|
rmuscarello
Starting Member
7 Posts |
Posted - 2002-06-03 : 10:22:23
|
| I'm using SQL 7.0 SP4 |
 |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-06-03 : 10:32:34
|
| Are you getting any error Message????What are you trying to do and how did you came to the conclusion it isnt expanding??can you post your entire script.-------------------------------------------------------------- |
 |
|
|
izaltsman
A custom title
1139 Posts |
Posted - 2002-06-03 : 10:42:00
|
| If you went to display the value of your @email variable after running that query, and the Query Analyzer has shown you only the first 255 characters in the results window, then the size of the variable is not an issue -- you simply need to change one of the display options in QA to show more characters (255 is the default). In QA go to Tools->Options->Results and enter 8000 in the "Max chars/column" box. |
 |
|
|
rmuscarello
Starting Member
7 Posts |
Posted - 2002-06-03 : 10:50:31
|
| When I run the job it fails. When I look at the job history it shows part of someone’s email address. That's why it fails because it doesn't recognize the last email address as being valid. However when I changed the data in the database so the email addresses plus ";" and a space in between the email address adds up to 255 characters it works. |
 |
|
|
|
|
|