You need to use
Dynamic SQL
There is an SQL command called
sp_ExecuteSQL
This will allow you build a string such as this and execute it:
DECLARE @MySQL VARCHAR(MAX)
SET @MySQL = 'SELECT * FROM DestinationDatabase.dbo.' + @TableName
EXEC sp_ExecuteSQL @MySQL
WARNING!!! WARNING!!! WARNING!!!
Make sure you understand the security implications of using dynamic SQL. Most website hacks are done by injecting addition SQL into dynamic SQL executions.
This is the MSDN article for sp_ExecuteSQL
http://msdn.microsoft.com/en-gb/library/ms188001.aspx[
^]
This is a article with covers the security risks.
The Curse and Blessings of Dynamic SQL[
^]