Limitations of @ - Local variable

  • Karthik,

    I can give you set of other "variable limitations".

    For example:

    SELECT * FROM @Table

    SELECT Value as @ValueName

    GROUP BY @Column

    etc.

    All these are actually cases of misuse of language elements typical for beginners.

    What means - RTFM!

    And it does not matter how many procedures you put Tally table in.

    If you cannot recognize the case when you need to use it - you still did not get the concept.

    It's not a guess, it's for sure.

    _____________
    Code for TallyGenerator

  • do you mean to use like below

    Create table #tmp

    (

    eno int,

    ename varchar(25)

    )

    go

    insert into #tmp

    select 1,'Karthik'

    union all

    select 2,'Keyan'

    union all

    select 3,'Ravi'

    go

    Declare @Name varchar(50)

    select @Name = 'Karthik,Keyan'

    Select @Name = ',' + @Name + ','

    Select eno,ename

    from #tmp

    where ename in (Tally table logic to split the values based on comma

    )

    karthik

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

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