1、设有以下存储过程,阅读存储过程,根据存储过程写出使用代码,并在网页中显示结果
CREATE PROCEDURE [dbo].[sp_sys_count]
-- Add the parameters for the stored procedure here
@tblName nVarchar(255), -- 表名
@strWhere nVarchar(255)='' -- 条件规则(where)
AS
declare @strSQL nVarchar(4000)
BEGIN
SET NOCOUNT ON;
if @strWhere != ''
set @strSQL = 'select count(*) as Total from ['+ @tblName +'] where '+ @strWhere
else
set @strSQL = 'select count(*) as Total from ['+ @tblName +']'
EXEC sp_ExecuteSql @strSql
END