Is it possible to pass a table name into a stored proc and use it without the Exec Function?
- 阅读更多 关于 Is it possible to pass a table name into a stored proc and use it without the Exec Function?
问题 I would like to create a SP or UDF where I supply a table and column name as a parameter and it does something to that target. I'm using Sql Server 2005 Trivial Example of what I'm trying to accomplish: CREATE FUNCTION Example (@TableName AS VARCHAR(100)) RETURNS TABLE AS BEGIN SELECT * INTO #temp FROM @TableName RETURN #temp END The example is just something trivial to illustrate what I'm trying to accomplish in terms of passing the Table name as a parameter. Is this possible to do w/o