Viewing 5 posts - 1 through 6 (of 6 total)
hi David,
in the article the varaibale is initialized with '' - an empty string. This is not necessary. When declaring a variable with out extra value assignment, it gets initialized...
March 22, 2011 at 3:47 am
hi Hugo,
I'd like to disagree. While the last example uses only @var = column the explanation above it clearly states:
"If a SELECT statement returns more than one row and the...
March 21, 2011 at 8:28 am
hi Hugo,
http://msdn.microsoft.com/en-us/library/ms187953.aspx
states that the result is defined as the value of the last row and not undefined as Umachandar in the Connect ticket says, should be corrected then.
USE AdventureWorks2008R2 ;
GO
DECLARE...
March 21, 2011 at 7:44 am
hi Hugo,
What do you mean with "incomplete data"?
I only found these articles:
http://sqlblogcasts.com/blogs/tonyrogerson/archive/2006/05/18/449.aspx
http://ryanfarley.com/blog/archive/2004/03/01/390.aspx
They only explain the obvious: When assigning a single value using the SELECT @var = column FROM table syntax...
March 21, 2011 at 7:05 am
hi,
I would either use one of both solutions:
DECLARE @Concat NVARCHAR(MAX) = '' ;
SELECT @Concat = @Concat + ', ' + StatusDesc
FROM MyStatus ;
SELECT STUFF(@Concat, 1,...
March 21, 2011 at 3:56 am
Viewing 5 posts - 1 through 6 (of 6 total)