How to create dynamic SQL sub string based on field name functionid without writing static ?
I have table name DoneCode i need when add new function on table Done code
automatically without rewrite or modify my code
so that i need to do
substring (DoneCode,@FunctionId,1)
but i done know how to do that
so suppose tommorrow add new Function as
10,PCN
so no need to add new function in code as substring(DoneCode,10,1) as PCN
I need to use substring(DoneCode,FunctionId,1) as FunctionId
but i dont know how to make within loop
so can you help me