Re: Returnung data with a running date timeframe
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Dec 2006 21:47:03 +0100
On Thu, 28 Dec 2006 05:58:00 -0800, chas2006 wrote:
Hi Hugo...I am not familiar with the Decalre statement. I work in Query
Analyzer exclusively with Select statements. Will Declare and Set update,
delete or change any live data in the tables.
Thank you.
Charlie
Hi Charlie,
The DECLARE command is used to declare a variable. So, after executing
DECLARE @MyVariable int;
SQL Server will reserve memory for the storage of a variable of the
integer type, known as @MyVariable. (Note: all variable names must begin
with @ in SQL Server).
The SET command is used for various things. It is part of the UPDATE
command, but by itself, it can be used to change database or connection
settings or to change the value of a variable. The syntax used in my
code was the latter version. Another example:
SET @MyVariable = 1;
After this command, the memory space reserved for the variable
@MyVariable is set to the integer value 1.
BTW, you could have found all this by checking Books Online. :-)
--
Hugo Kornelis, SQL Server MVP
.
- References:
- Re: Returnung data with a running date timeframe
- From: Hugo Kornelis
- Re: Returnung data with a running date timeframe
- From: chas2006
- Re: Returnung data with a running date timeframe
- Prev by Date: Re: Returnung data with a running date timeframe
- Previous by thread: Re: Returnung data with a running date timeframe
- Index(es):
Relevant Pages
|
|