I need to concatenate a variable table name into my SQL query such as the following...
ALTER FUNCTION fn_myfunction(@KeyValue text) BEGIN INSERT INTO @tmpTb
You could make use of Prepared Stements like this.
Prepared Stements
set @query = concat( "select name from " ); set @query = concat( "table_name"," [where condition] " ); prepare stmt from @like_q; execute stmt;