On 3?22?, ??2?57?, rking(ISV) <r...@nospam.nospam> wrote:
> I'm writing several stored procedures that test the value of Integers which
> are represented by enumerated values in the VB application. My procedures
> are testing for 0,1,2 . . ., instead of new, scheduled, sent, cancelled, .. . .
>
> I've considered using a user defined function such as
> uf_pmntStatus (status as varchar(10) as integer
> set ud_pmntStatus = case status when 'new' then 0
> when 'scheduled' then 1
> when 'sent' then 2
> .
> .
> .
> end
>
> Then I could use
> item = uf_pmntStatus('new')
>
> However, I'm now maintaining a list in my UDF and a list in my common VB area.
> Is it reasonable, possibe, acceptable to write a CLR routine for SQL that
> could use the VB defined enum values?
why not add a table of status,then you can reference it at everywhere
as you want to no matter at proc or functions :)