Can SQL Server 2000's Select statement assign multi-variables from Table?
e.g. Select @.CustomerName = CustomerName, @.EffectiveDateFrom =
EffectiveDateFrom, @.EffectiveDateEnd = EffecitveDateEnd from Customer where
customercode = 'XXX'.> Can SQL Server 2000's Select statement assign multi-variables from Table?
Yes. When multiple rows are returned, only values from the last row
returned are assigned.
Hope this helps.
Dan Guzman
SQL Server MVP
"ABC" <abc@.abc.com> wrote in message
news:eWjrMTBEGHA.1312@.TK2MSFTNGP09.phx.gbl...
> Can SQL Server 2000's Select statement assign multi-variables from Table?
> e.g. Select @.CustomerName = CustomerName, @.EffectiveDateFrom =
> EffectiveDateFrom, @.EffectiveDateEnd = EffecitveDateEnd from Customer
> where customercode = 'XXX'.
>|||Yes it can. Have you tried it and getting an error or just asking?
Andrew J. Kelly SQL MVP
"ABC" <abc@.abc.com> wrote in message
news:eWjrMTBEGHA.1312@.TK2MSFTNGP09.phx.gbl...
> Can SQL Server 2000's Select statement assign multi-variables from Table?
> e.g. Select @.CustomerName = CustomerName, @.EffectiveDateFrom =
> EffectiveDateFrom, @.EffectiveDateEnd = EffecitveDateEnd from Customer
> where customercode = 'XXX'.
>
Wednesday, March 7, 2012
Can SQL Server 2000's Select statement assign multi-variables from Table?
Labels:
assign,
customername,
database,
effectivedatefrom,
microsoft,
multi-variables,
mysql,
oracle,
select,
server,
sql,
statement,
table,
tablee
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment