Hi all.Mi first issue, mi first post. I hope this will be the first of many times that I can help or being helped.This is what I got:if ((select version from VersionInfo) = 11)begin select Tmp.HomeOperator, Tmp.Operation,Tabla.CurrTechnology, Tmp.Estado,Tiempo=sum(Tabla.Duration) from #HSDPA Tmp, (select t.sessionid,t.TestId,t.currtechnology,sum(t.Duration) as Duration from #HSDPA h, technology t where h.Operation in ('Downlink','Uplink') and h.host not in ('10.132.144.18','194.224.26.150') and h.testid=t.testid group by t.sessionid,t.testid,t.currtechnology) as Tabla where Tmp.testid=Tabla.Testid and tabla.currtechnology is not null group by Tmp.HomeOperator,Tmp.Operation,Tabla.CurrTechnology,Tmp.Estado ;endelsebegin select Tmp.HomeOperator, Tmp.Operation,Tabla.CurrTechnology, Tmp.Estado,Tiempo=sum(Tabla.Duration) from #HSDPA Tmp, (select a.sessionid,a.testid,a.currtechnology,sum(datediff(ms,a.msgtime,b.msgtime)) as Duration from #HSDPA h, technology a,technology b where h.Operation in ('Downlink','Uplink') and h.host not in ('10.132.144.18','194.224.26.150') and h.testid=a.testid and a.testid=b.testid and a.techid+1=b.techid group by a.sessionid,a.testid,a.currtechnology) as Tabla where Tmp.testid=Tabla.Testid and tabla.currtechnology is not null group by Tmp.HomeOperator,Tmp.Operation,Tabla.CurrTechnology,Tmp.Estadoend
As you may notice, the thing i want to do is simple. If the value of version is 11, then we launch some code, if not, we execute some different.I'm programming this to execute on two different databases. Both of them have the technology table. Since this is not the problem, this table has not the same columns on both DB's. And SQL Server 2008 seems to pay attention to it, even if the code is not executed. I'm having the invalid column name on the red lighted below. It's true, techid isn't valid in the technology table i'm working with. I've noticed that piece of code is never reached adding an easy "PRINT 'Not Version 11';" line instead the other query and i don't have neither the invalid column error or the string printed on screen.Is there any scripting option or something like that i can deactivated to avoid this problem? Is just like that Server 2008? I think this wouldn't be an issue using Server 2005, but this couldn't be the solution. I need some help on this, guys.