执行存储过程时无输出

时间:2015-05-26 23:41:32

标签: sql sql-server stored-procedures procedure

执行存储过程时无输出。 select语句在我创建新查询时有效,但在我的Web应用程序中调用存储过程时不返回任何值。

 

1 个答案:

答案 0 :(得分:0)

你想要一个动态的SQL。 试试这个。

Declare @strSQL nvarchar(2000)
set @strSQL = 'SELECT * FROM investor WHERE ' + @search_by + ' = ''' + @col + ''''
execute sp_executesql @strSQL
相关问题