<p>I have 15 stored procedures that return data from a common table and then join that table with a specific table to retrieve inventory.</p>

<p>Example:</p>

<pre><code>Common: tblCommon
Specific: tblSpecific
</code></pre>

<p>Is there way I can pass the name "tblSpecific" into a single stored procedure as a variable, like the following?</p>

<pre><code>SELECT ....
FROM tblCommon c
INNER JOIN @TABLE s on c.primaryKey = s.foreignKey
</code></pre>

Yep, you can generate an SQL statement dynamically and then execute it.
For example,
```
```
DECLARE @specificTableName nvarchar(50)
DECLARE @specificColumnName nvarchar(50)

SET @specificTableName = 'tblSpecific'
SET @specificColumnName = 'colSpecific'

DECLARE @sql nvarchar(4000)

set @sql = 'SELECT ... FROM tblCommon c INNER JOIN ' +
@specificTableName + ' s ON c.PrimaryKey = s.' + @specificColumnName

exec (@sql)
```
```