不是很明白你的问题;用变量作为查询条件很简单declare @dt varchar(30);---定义变量set @dt="启动";--给变量赋值select * from Table1 where a1=@dt;---查询语句