VB 下: if textbox1.text.trim <> "" then strSql = "select * from abc where 123 = '" + textbox1.text.trim +"'" else strSql = "select * from abc " end if ...
如果想直接在SQL里面处理:
Create Proc pr_GetRecords ( @Text varchar(100) ) as
if @text = '' select * from abc else select * from abc where 123 = @text