Re: general question



thanks for your response
MJ

"Roy Harvey" <roy_harvey@xxxxxxxx> wrote in message
news:uhtha398sc8vocro8ib3mga29a2lbhj7v1@xxxxxxxxxx
If I had to choose just one it would have to be SELECT simply because
there are times SET will not do the job.

One more point that I did not see coverd in the article linked by
Jason. It is common to want to retrieve both the @@error and
@@rowcount values resulting from a command. To get both and save them
to @variables (commonly @error and @rowcount) you MUST use SELECT, as
the @@values are destroyed by the first command that retrieves them.

I use SET to assign a constant, or perhaps increment a counter, but
use SELECT when the data comes from a query or is otherwise more
complicated. But I don't pretend that is "best practice", as I don't
believe there is a clear best here.

Roy Harvey
Beacon Falls, CT

On Thu, 26 Jul 2007 10:59:17 -0700, "MikeJ"
<vettes_n_jets@xxxxxxxxxxxxx> wrote:

hi...i would like to know best practice when assigning a value to a
variable
example below

set
or
select

declare @var1 varchar(25)
set @var1='abc'
select @var1='abc'

to me
set is implicit
select implies conditions

i see both used all over the place here at my new company....
so witch is better practice

tks
MJ




.



Relevant Pages

  • Re: Iron Palm and Iron Vest Workshop: Earlybird Discount Ends Soon!
    ... Billions of asians, for centuries. ... Tumo was 'common knowledge'- and proven. ... he does NOT demonstrate on skeptics, ... but they wouldn't teach you how to practice it. ...
    (rec.martial-arts)
  • Re: One cause of High Blood Pressure
    ... >> Thank you for the legal advice which you have dispensed to Jason ... >> I am curious, though, about the applicibility of your legal advice. ... where are you licensed to practice law? ... "most hypertension is caused by primary aldosterosim". ...
    (sci.med.cardiology)
  • Re: Democratic System
    ... When the beastly practice of Autocratic and Theocratic ruling reached ... Ideals of democracy are difficult to be realized in practical ... time to share in common activities, ... in reality what we see that the common man is indolent in politics. ...
    (soc.culture.pakistan)
  • Re: The Chi FAQ v1.1.7
    ... Alot of money making pyramid schemes have that prereq as well. ... component, nor the physical component, nor the diligent practice component- ... common in China- and no doubt the practice of those that have stolen the ... the producers of the Nobel Prize competition, or the ...
    (rec.martial-arts)
  • Re: are character*4 and integer*4 the same thing, storage wise ?
    ... I've always wondered why arbiters of the standard ignore what is common ... point of my para above was to explain that the practice in question was ... makes them fail when you move code between machines with different data ...
    (comp.lang.fortran)