declare @str varchar(max) --傳遞數字 :cloumn int --同義-執行-> select * from table0 where cloumn0=1; set @str='select * from table0 where cloumn0='+1; exec(@str); --傳遞字符串 :cloumn varchar 這里雙單引號 --同義-執行-> select * from table0 where cloumn0='1'; set @str='select * from table0 where cloumn0=''1'''; exec(@str)