June 30, 2004 at 10:19 pm
Calvin,
If your server is set to CONCATENIZATION OF NULL YIELDS NULL, then you will need either COALESCE or ISNULL unless you preset the variable to something other than NULL.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 1, 2004 at 12:20 pm
true, or you can use something like this (for a csv, say):
select @var = isnull(@var + ',', '') + value from table.
If I dealing with a lot of rows or a query that's run all the time I'll set the variable to and empty string at the beginning. If not I'll use the isnull, as it looks nicer.
cl
Signature is NULL
Viewing 2 posts - 16 through 16 (of 16 total)
You must be logged in to reply to this topic. Login to reply