Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2014-07-18 : 03:19:38
|
HiIn some of our business object reports we have to create variables to decode values to what we want. I am trying to replicate this in SQL Server and remember doing this in SQL server 2000 years ago back can't remember the exact way to do it. I remember running a query and calling stored proc within query which would return the value I wanted but not sure if I can still do this in SQL server 2008 and by that I mean doing it within query or have to do it another way.Basically what I want is to have a procedure with all the variables replicated within that procedure so that when I run a query I can just call the appropriate bit of code by passing a specific name like select job.dept, dbo.decodevariable('ShowJobDesc' job.jobtitle), job.salaryfrom jobso 'ShowJobDesc' and the job.jobtitle would be used to decode each job title to return job description.Just a bit unsure and can't remember if I am doing this the right way, is this possible?Many Thanks for any help/adviceG |
|
Grifter
Constraint Violating Yak Guru
274 Posts |
Posted - 2014-07-18 : 03:31:13
|
Actually just remembered it was User Defined Function I used to use!Which can be called in query. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
|
|
|
|