set @LikeSql = ‘someword%';--把LikeSql变量赋值,可以赋值成'%xxxxxxxxxxxx%'
declare @SelectSql nvarchar(128)--定义Sql语句,开始拼Sql
set @SelectSql = ‘select * from Table where [Column] like @LikePar';—使用@LikePar变量进行参数化
exec sp_executesql @SelectSql ,N'@LikePar as varchar(32)',@LikePar = @LikeSql;--使用sp_executesql来执行