我有一个名为“colamer”的表,如下所示:
ID Title SectionID
1 abc 231
2 abc 232
3 pqr 95
4 jkl 165
我的存储过程:
CREATE PROCEDURE CheckDuplicateBannerforSection
/*
colamer_CheckDuplicateBannerforSection 'abc','231,232,233',NULL
*/
@BannerTitle NVARCHAR(200),
@SectionId VARCHAR(50),
@Result VARCHAR(100) OUT
AS
BEGIN
SET @Result = 1
BEGIN
IF EXISTS
(SELECT 1 FROM colamer WHERE Title= @BannerTitle
And SectionID in(SELECT value FROM dbo.colamer_fn_Split1( @SectionId ,',')))
END
SELECT @Result
结尾
我想要输出:@result = 231,232