My Photo

Consulting/Training

Speaking engagement

January 2007

Sun Mon Tue Wed Thu Fri Sat
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      

My Online Status

Disclaimer

  • No Warranty..
    I have taken care in writing the articles on this blog and make no implied or expressed warranty of any sort. For any errors or omissions, I will not be responsible in any way.

« olap: installation of analysis services | Main | tsql: Very simple user defined function »

April 21, 2005

Comments

john

Very good.

Anon

Excellent

R. Schreurs

Very useful. Avoids the tedious use of cursors.
I never noticed that the variable assignment is evaluated for each row.
Apparently, typical assingments like
SELECT
@colors = Color
FROM
Colors,
in which the query returns multiple rows, are evaluated for each row in turn, overwriting the prior assignment of @colors.

Dave

R. Schreurs you are correct. The following post has a lot of useful insight on the bugs that can arise from using SELECT to set variable values.

    http://blogs.msdn.com/b/davidlean/archive/2009/08/22/using-tsql-variables-subtle-bug-when-assigning-values-to-variables-via-a-query.aspx

Buy Viagra

This blog is really interesting, actually i prefer this kind of information because i can learn too much about it and when somebody else ask me about it, so i will replay correctly. very nice blog!!!!

Daniel Latikaynen

@rschreuers: but this one works!?
Is it secure?

DECLARE @@concat VARCHAR(8000)
SELECT @@concat = COALESCE(@@concat + ', ', '') + fieldname from
select @@concat

Jordan Basketball shoes

I have always believed that the man who has begun to live more seriously within begins to live more simply without.

The comments to this entry are closed.