This is a two part question. Part one i am certain is simple and i am just over looking it. maybe from staring at the computer screen all day.
Anyway i have this column in a database, it is currently nvarchar(5), inside this are 4 digit numbers, what i want to do is create a view that will take this column, pull out the first two digits of every number in that column, turn it into an INT to make it easier to check the value then depending on the value create a string. Here is one thing i have been trying and it keeps saying there is an error in my syntax.
Select case cast(left(empdept,2) as INT) WHEN 21 then 'Engineering' when 23 then 'Maintenance' else 'Production' from prodemptable
the second question pertains to locked stored proceedures. No one here locked them and well we would like to take a peek inside and see what is in there, we think they are old reminants of a long gone time clock system. But no one know for certain. Is there anyway to find out why the lock is there and how to at least view what is within the stored proceedure?