Home All Groups Group Topic Archive Search About
Author
2 Sep 2005 11:55 AM
Ion Popescu
Which one is faster (regarding compilation time and execution time):

SELECT @var1=(some expression),
@var2=(other expression),
[...]
@var6=(last expression)

or:

SET @var1=(some expression)
SET @var2=(other expression)
[...]
SET @var6=(last expression)

All expressions are arithmetical expressions based on other variables
(and maybe some built-in functions, like ROUND) (but no subqueries,
UDF-s, etc). The data type of the variables is usually money. The code
will be in a stored procedure.

Author
2 Sep 2005 12:08 PM
R.D
Hi
WHICH IS BETTER VANILLA OR STRAWBERRY.THAT DEPENDS ON YOUR TONGUE.
No difference as for as cost and performance.Absolutely both are same.
Regards
R.D

Show quote
"Ion Popescu" wrote:

> Which one is faster (regarding compilation time and execution time):
>
> SELECT @var1=(some expression),
> @var2=(other expression),
> [...]
> @var6=(last expression)
>
> or:
>
> SET @var1=(some expression)
> SET @var2=(other expression)
> [...]
> SET @var6=(last expression)
>
> All expressions are arithmetical expressions based on other variables
> (and maybe some built-in functions, like ROUND) (but no subqueries,
> UDF-s, etc). The data type of the variables is usually money. The code
> will be in a stored procedure.
>
>
Author
2 Sep 2005 2:10 PM
JT
Yes, but which is *faster*: a vanilla bean or a strawberry?

Show quote
"R.D" <R*@discussions.microsoft.com> wrote in message
news:92D1FFEB-90ED-41F5-B323-57498AEFD8B0@microsoft.com...
> Hi
> WHICH IS BETTER VANILLA OR STRAWBERRY.THAT DEPENDS ON YOUR TONGUE.
> No difference as for as cost and performance.Absolutely both are same.
> Regards
> R.D
>
> "Ion Popescu" wrote:
>
>> Which one is faster (regarding compilation time and execution time):
>>
>> SELECT @var1=(some expression),
>> @var2=(other expression),
>> [...]
>> @var6=(last expression)
>>
>> or:
>>
>> SET @var1=(some expression)
>> SET @var2=(other expression)
>> [...]
>> SET @var6=(last expression)
>>
>> All expressions are arithmetical expressions based on other variables
>> (and maybe some built-in functions, like ROUND) (but no subqueries,
>> UDF-s, etc). The data type of the variables is usually money. The code
>> will be in a stored procedure.
>>
>>
Author
4 Sep 2005 4:26 AM
Louis Davidson
Vanilla.  Any other answer makes you just wrong :)

--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)

Show quote
"R.D" <R*@discussions.microsoft.com> wrote in message
news:92D1FFEB-90ED-41F5-B323-57498AEFD8B0@microsoft.com...
> Hi
> WHICH IS BETTER VANILLA OR STRAWBERRY.THAT DEPENDS ON YOUR TONGUE.
> No difference as for as cost and performance.Absolutely both are same.
> Regards
> R.D
>
> "Ion Popescu" wrote:
>
>> Which one is faster (regarding compilation time and execution time):
>>
>> SELECT @var1=(some expression),
>> @var2=(other expression),
>> [...]
>> @var6=(last expression)
>>
>> or:
>>
>> SET @var1=(some expression)
>> SET @var2=(other expression)
>> [...]
>> SET @var6=(last expression)
>>
>> All expressions are arithmetical expressions based on other variables
>> (and maybe some built-in functions, like ROUND) (but no subqueries,
>> UDF-s, etc). The data type of the variables is usually money. The code
>> will be in a stored procedure.
>>
>>
Author
2 Sep 2005 12:29 PM
markc600
Author
2 Sep 2005 2:01 PM
Sericinus hunter
Ion Popescu wrote:
> Which one is faster (regarding compilation time and execution time):
>
> SELECT @var1=(some expression),
> @var2=(other expression),
> [...]
> @var6=(last expression)
>
> or:
>
> SET @var1=(some expression)
> SET @var2=(other expression)
> [...]
> SET @var6=(last expression)

SELECT (as a single statement) may be faster than a number of SETs
(multiple statements). This can make practical difference if
used in a loop.

Microsoft recommends using SET over SELECT as the latter is not
standard.
Author
5 Sep 2005 1:39 AM
Stefan Berglund
On Fri, 02 Sep 2005 14:01:27 GMT, Sericinus hunter <serh***@flash.net> wrote:
in <XWYRe.3786$v83.2***@newssvr33.news.prodigy.com>

Show quote
>Ion Popescu wrote:
>> Which one is faster (regarding compilation time and execution time):
>>
>> SELECT @var1=(some expression),
>> @var2=(other expression),
>> [...]
>> @var6=(last expression)
>>
>> or:
>>
>> SET @var1=(some expression)
>> SET @var2=(other expression)
>> [...]
>> SET @var6=(last expression)
>
>SELECT (as a single statement) may be faster than a number of SETs
>(multiple statements). This can make practical difference if
>used in a loop.
>
>Microsoft recommends using SET over SELECT as the latter is not
>standard.

Yeah, well Microsoft also recommends that you trash any VB6 code you may have in
favor of VB.NET so what are you gonna do?

---
Stefan Berglund
Author
5 Sep 2005 6:49 AM
Louis Davidson
> Yeah, well Microsoft also recommends that you trash any VB6 code you may
> have in
> favor of VB.NET so what are you gonna do?

Use T-SQL for everything? :)


--
----------------------------------------------------------------------------
Louis Davidson - http://spaces.msn.com/members/drsql/
SQL Server MVP
"Arguments are to be avoided: they are always vulgar and often convincing."
(Oscar Wilde)

Show quote
"Stefan Berglund" <keepit@in.thegroups> wrote in message
news:kc8nh1plg5dbgl85rkkqr71unoa9do2gru@4ax.com...
> On Fri, 02 Sep 2005 14:01:27 GMT, Sericinus hunter <serh***@flash.net>
> wrote:
> in <XWYRe.3786$v83.2***@newssvr33.news.prodigy.com>
>
>>Ion Popescu wrote:
>>> Which one is faster (regarding compilation time and execution time):
>>>
>>> SELECT @var1=(some expression),
>>> @var2=(other expression),
>>> [...]
>>> @var6=(last expression)
>>>
>>> or:
>>>
>>> SET @var1=(some expression)
>>> SET @var2=(other expression)
>>> [...]
>>> SET @var6=(last expression)
>>
>>SELECT (as a single statement) may be faster than a number of SETs
>>(multiple statements). This can make practical difference if
>>used in a loop.
>>
>>Microsoft recommends using SET over SELECT as the latter is not
>>standard.
>
> Yeah, well Microsoft also recommends that you trash any VB6 code you may
> have in
> favor of VB.NET so what are you gonna do?
>
> ---
> Stefan Berglund

AddThis Social Bookmark Button