Viewing 15 posts - 391 through 405 (of 1,114 total)
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...
October 17, 2008 at 2:10 am
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)....
October 17, 2008 at 1:54 am
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...
October 17, 2008 at 1:49 am
is there any other command or clause that won't work directly with local variable ?
October 16, 2008 at 7:50 am
No....our eyes has the limitation.... :Whistling:
do you agree or not ?:D
October 16, 2008 at 7:40 am
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.
October 16, 2008 at 7:34 am
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...
October 16, 2008 at 7:31 am
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...
October 16, 2008 at 7:26 am
Steve,
Concur... Sometime we may miss what we know very well.
October 16, 2008 at 7:24 am
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...
October 16, 2008 at 7:17 am
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...
October 16, 2008 at 7:14 am
Glen,
You are correct !
My point is, we can't use local variable in the order by clause directly.
do you agree ?
October 16, 2008 at 7:13 am
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)
October 16, 2008 at 7:12 am
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...
October 16, 2008 at 6:20 am
Viewing 15 posts - 391 through 405 (of 1,114 total)