使用execute来执行字符串 使用Northwind数据库 declare @sql nvarchar(200) set @sql='select * from customers' exec(@sql)