Yes, i did give a simplified version
Thank you to everyone for thier input - of the lot, the suggestion made by MDXer (dynamic sql)will do the job for me at this time.
Thanks Again.
In case any one has any better suggestions, here is a bit more detail though still simplified.....
Creating Intranet - storing attributes(form name,control name,datatype etc.)in db table1. When user hits save button, values in controls need to be saved --> values stored in table2 as string --> save routine grabs values (table2) and datatype (table1) and must first convert the value to its appropriate datatype --> all values stored in table2 as string but if value in database table to update is of type 'money' or 'int', will need to convert that value then update the appropriate table/tables....
input param:
@TableColName
@WebFormName
@WebControlID
/*********************************/
--GET DATATYPE
/*********************************/
SELECT @DATATYPE = DATATYPE
FROM table1
WHERE WEB_CONTROL_ID = @WEBCONTROLID
/***********************************/
--GET VALUE TO BE SAVED IN DATABASE
/***********************************/
SELECT @VALUE = VALIDATE_VALUE
FROM table2
WHERE TableColName = @TableColName
AND WEBFORM_NAME = @WEBFORMNAME
AND WEB_CONTROL_ID = @WEBCONTROLID
/*********************************/
--SAVE VALUE IN DATABASE TABLES:
/*********************************/
SELECT @STRSQL = 'UPDATE table3'
SELECT @STRSQL = @STRSQL + 'SET table3.AMOUNT = CAST(' + @VALUE + ' AS ' + @DATATYPE + ') '
SELECT @STRSQL = @STRSQL + 'WHERE table3.TableColName= ' + '''' + @TableColName+ ''''
EXECUTE(@STRSQL)