@NameS存储过程带 集合的参数
--例如:在程序中,先编辑好了 string NameS=" '小明','小李','小黄' "; --调用存储过程 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[SP_PrcName]
(
@NameS NVARCHAR(100), @StatDate datetime ) AS SET NOCOUNT ON
DECLARE @condition VARCHAR(MAX)= '' SET @condition = 'FDate>=cast(''' + CAST(@StatDate AS VARCHAR(20)) + '''AS datetime)';
EXEC( 'SELECT*FROM T_tableName WHERE name IN ('+@NameS+')' +@condition ) RETURN @@ERROR