I am doing some optimization and am looking for anything that will help.
I have some code as follows
Declare @mxid numeric(18,0)
select @mxid = max(convert(numeric(18,0),id_c)) + 1 from ra.trmstr
id_c is a character field, I know, it shouldn't be but it is. If I don't do the convert, since it is a character, it thinks 9089 is larger than 12098. When I try cast, it is about the same performance wise. Is this optimized fully or can it be tweaked?
Thanks,
Eddie