ALTER PROCEDURE [dbo].[messageCountByWhere]
@where varchar(8000) = ' 1=1 ',
@recordCount int output
AS
SET NOCOUNT ON
declare @sqlCount nvarchar(4000)
set @sqlCount= 'SELECT @Count=count(-1) FROM [dbo].[message] WHERE ' +@where
--print @sqlCount
exec sp_executesql @sqlCount,N'@Count int output',@recordCount output
RETURN @@Error
count(-1)有啥意思 ? 还有 exec 中 N'@Count int output',@recordCount output 表示什么意思 , 希望给你解释
慕少森