Set Question

  • is it possible to set more than one local variable from just on select

    ie

    declare @comp_id varchar(12)

    declare @prodno varchar(12)

    set @comp_id,@prodno = select comp_id,prodno

    from stock

    where stock_id = '11'

    thanks

    Randy

  • Something like this should work for you:

    declare @comp_id varchar(12)

    declare @prodno varchar(12)

    select @comp_id=comp_id,@prodno=prodno

    from stock

    where stock_id = '11'

    Gregory Larsen, DBA

    If you looking for SQL Server Examples check out my website at http://www.geocities.com/sqlserverexamples

    Gregory A. Larsen, MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply