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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Concatenation

Author  Topic 

victord
Yak Posting Veteran

64 Posts

Posted - 2002-06-18 : 11:49:38
Dear Folks,
I am updating a table with values from another table and at the same time adding numbers infront of this values.

In other words trying to cocatenate these numbers with values retreived from anothe table. Now the catch to this scenario is that,
whetether i get values from the foreign table or not to update my table, there must be a value in that column, either the numbers i am
using to concatenate the values or both the values and numbers in the same column. i.e

{'000' + +'Barcode '} in barcode column,

000 being the number and 'barcode' being the value i get from the foreign table. I have tried this but it keeps bringing null values, which probably means it wont update the column with just the numbers without a coresponding value.

Please help.
Vic


AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2002-06-18 : 12:02:35
would you mind giving us sample input data and sample expected results.....plus DDL for the tables involved in case there is some complications brought upon by the column datatypes?


what you've given is a little bit vague...

a couple of rows of input data, and a couple of rows of expected results will do....and include boundary conditions...nulls, 0's, spaces, etc...in the input data....

Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-06-18 : 12:06:50
Would COALESCE(BarCode, '') help?

Or look at SET CONCAT_NULL_YIELDS_NULL { ON | OFF }

Go to Top of Page
   

- Advertisement -