I didn't see any syntax error in bitsmed's code; so I copied the code and installed it - still didn't get any error. Then created a table like this and ran the stored proc - still didn't get any error. So I am unable to figure out why you are getting an error.Double click on the error and see where it takes you to. Is it on the parameter definition, or is it where @colname is used?CREATE TABLE table1 ( secondcolumn VARCHAR(32), thirdcolumn VARCHAR(32), price1 INT, price2 INT, price3 INT, [date]DATETIME);INSERT INTO table1 VALUES ( '45','abc',1,2,3,'20120801');