Click here to Skip to main content
15,894,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if yes then how?
because i am create a function with parameter name should be table name.
Posted
Updated 20-Sep-15 23:11pm
v2
Comments
[no name] 21-Sep-15 9:08am    
As "Abhinav S" mentioned there in the below solution you can pass the tablename to your stored procedure like a parameter whose datatype would be varchar.

You can pass the table name as a string.
 
Share this answer
 
As Abhinav S said you can pass the table name as a string.

SQL
EXECUTE mySP 'mytable'

CREATE PROCEDURE mySP (@mtab VARCHAR(100)) AS...



Using it in the SP is another problem.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900