SP_Execute Executes a Transact-SQL statement or batch that can be reused many times, or one that has been built dynamically. The Transact-SQL statement or batch can contain embedded parameters
Declare @var nvarchar
SET @var=='Select * from table1'
SP_Excecutesql @var