Hi,
I have a parameter called @version which can be 1, 2, 3, 4, 5
I have 5 columns in my table, price_1, price_2, etc.
I have a stored procedure to get a price which has a parameter called @version
So depending on the value, I have to get price_1, _2, etc.
Right now I build an SQL string and using exec to execute this string.
... PRICE_' + @VERSION + ' as SALES_PRICE ...
Is there an easier way to do this? Preferably without building this SQL string, since this is a pain in the ass debugging.
Thanks you in advance,
G.I.
I have a parameter called @version which can be 1, 2, 3, 4, 5
I have 5 columns in my table, price_1, price_2, etc.
I have a stored procedure to get a price which has a parameter called @version
So depending on the value, I have to get price_1, _2, etc.
Right now I build an SQL string and using exec to execute this string.
... PRICE_' + @VERSION + ' as SALES_PRICE ...
Is there an easier way to do this? Preferably without building this SQL string, since this is a pain in the ass debugging.
Thanks you in advance,
G.I.