Q
Problem solve Get help with specific problems with your technologies, process and projects.

Passing a table's name to a stored procedure as input parameter

I have a stored procedure in SQL Server which does something on some tables. The problem is that I have to pass the table's name which I want to act on to a SP as an input parameter. What can I do?

You need to use dynamic SQL to do this. http://www.mssqlserver.com/faq/development-dynamicsql.asp.

For More Information

Dig Deeper on SQL Server Stored Procedures

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close