Hello all,
I am using SQL 2000 SP4. I was wondering if there was a way to assign a sql
result to a variable. The sql result I want to assign only returns one
number.
Any help is appreciated, thanks.> I am using SQL 2000 SP4. I was wondering if there was a way to assign a
> sql
> result to a variable. The sql result I want to assign only returns one
> number.
Without any detail, we can only guess. Perhaps:
declare @.test int
set @.test = (select max(column) from dbo.table)|||That works, thanks.
"Scott Morris" wrote:
> Without any detail, we can only guess. Perhaps:
> declare @.test int
> set @.test = (select max(column) from dbo.table)
>
>|||supersonic_oasis wrote:
> Hello all,
> I am using SQL 2000 SP4. I was wondering if there was a way to assign a s
ql
> result to a variable. The sql result I want to assign only returns one
> number.
> Any help is appreciated, thanks.
This might work:
DECLARE @.MyVariable INT
SELECT @.MyVariable = column FROM table WHERE condition is true
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment