I need to create a function in sql server that receives a table name. The table name will be used to create a select statement and return a result set. The result set will be processed and returned back.
Something like this:
SELECT * FROM @table_name WHERE id=1