Forum Replies Created

Viewing 15 posts - 391 through 405 (of 1,114 total)

  • RE: Limitations of @ - Local variable

    I'm feel sorry for Jeff Moden who spent so much time and effort on educating you.

    As I told him from the beginning, it was for nothing.

    Sergiy,

    My friend....Don't feel....Also don't insert...

  • RE: Limitations of @ - Local variable

    And after all those training given to you on Tally table you still trying to do IN (@var) things.

    I am not asking how to implement Tally table to replace IN(@var)....

  • RE: Limitations of @ - Local variable

    Not sure about juniors, but even medium level developers (developers, not system engineers) suppose to know the difference between values and identifiers.

    As a senior, you shouldn't discourage junior or medium...

  • RE: Limitations of @ - Local variable

    is there any other command or clause that won't work directly with local variable ?

  • RE: Limitations of @ - Local variable

    No....our eyes has the limitation.... :Whistling:

    do you agree or not ?:D

  • RE: Limitations of @ - Local variable

    Rosh,

    will you see your back head directly ? 😛

    But there is always a workaround.

    I hope all of us know it.

    We can see through mirror. 😀

    Just kidding.

  • RE: Limitations of @ - Local variable

    Rosh,

    Thats what i am also saying...There is a workaround...But there is no direct way to use the local variable in IN and ORDER BY clause.

    Can we say it as...

  • RE: Limitations of @ - Local variable

    Rosh,

    As you stated the below code will work for single value.

    Declare @eno varchar(10)

    declare @str varchar(100)

    set @eno = '1'

    select * from #tmp where eno in ( @eno)

    But if am going to...

  • RE: ALTER TABLE problem?

    Steve,

    Concur... Sometime we may miss what we know very well.

  • RE: Limitations of @ - Local variable

    And...I have implemented both your method in that project depends on the situation.

    But what i am saying is there is no direct way to use the local variable in an...

  • RE: Limitations of @ - Local variable

    Glen/RP,

    I do agree with you. Both of you gave the work around for the problem.

    is it possible to use like below

    select * from emp order by @column. This is what...

  • RE: Limitations of @ - Local variable

    Glen,

    You are correct !

    My point is, we can't use local variable in the order by clause directly.

    do you agree ?

  • RE: Limitations of @ - Local variable

    Well, Execute the below one.

    drop table #tmp

    go

    Create table #tmp

    (

    eno varchar(1),

    ename varchar(25)

    )

    go

    insert into #tmp

    select '1','Karthik'

    union

    select '2','Keyan'

    union

    select '3','Mani'

    Declare @eno varchar(5)

    select @eno = '1,2'

    select * from #tmp where eno in (@eno)

  • RE: Limitations of @ - Local variable

    Glen,

    We can use like you mentioed in your post.

    But the below one won't work.

    drop table #tmp

    go

    Create table #tmp

    (

    eno varchar(1),

    ename varchar(25)

    )

    go

    insert into #tmp

    select '1','Karthik'

    union

    select '2','Keyan'

    union

    select '3','Mani'

    Declare @Column varchar(5)

    select @Column...

  • RE: Swapping Columns

    Dynamic SQL.

    How ?

Viewing 15 posts - 391 through 405 (of 1,114 total)