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 |
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2004-07-31 : 00:53:04
|
| Hi all,@a = @a + @b (where @a and @b are varchar) doesn't seem to work. Any idea why?ThanksAdi-------------------------/me sux @sql server |
|
|
kselvia
Aged Yak Warrior
526 Posts |
Posted - 2004-07-31 : 01:28:57
|
| varchar or varchar(nn)? varchar is 1 character if you don't specify a length. Also, @a and @b can not be null or the result will be null, other than that, what you described should work fine.--KenYour Kung-Fu is not strong. -- 'The Core' |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2004-07-31 : 01:59:55
|
| If @a or @b might be NULL then trySELECT @a = COALESCE(@a, '') + COALESCE(@b, '')Kristen |
 |
|
|
t1g312
Posting Yak Master
148 Posts |
Posted - 2004-07-31 : 03:00:29
|
| It works now. Thanks Kristen and ken!Adi-------------------------/me sux @sql server |
 |
|
|
|
|
|