首先要保证变量类型与你的列名类型相同!!
你测试看看!
declare @test varchar(20)
set @test='a'
select * from biao where data2 like '%'+@test+'%'
select * from bbsTopic where Ttopic like @name
select * from bbsTopic where Ttopic like '%'+@name+'%'
select * from bbsTopic where Ttopic like '%'||@name||'%';