Hello fiends i am creating on stored procedure but i am not able to pass list as paramter code is as following
USE [DBdiamond]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE [dbo].[ListDiamonds]
(
@shape Nvarchar(Max)=null
) AS
BEGIN
if @shape='' or @shape='NULL'
BEGIN
select * from Diamondmst;
END;
ELSE
BEGIN
select * from Diamondmst d where d.shape IN (@shape);
END;
END;
i want to pass the @shape like @share='ROUND','PEAR'
so how can i pass sting list pls suggest
Loading


Anoop Kumar SharmaRank #127 · 17.4K reputationPosted Apr 6, 2022, 9:04 AM EDT
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Apr 6, 2022, 9:02 AM EDT
Jayraj ChhayaRank #304 · 8.2K reputationPosted Apr 6, 2022, 9:57 AM EDT
Sachin SinghRank #66 · 26.2K reputationPosted Apr 6, 2022, 11:13 AM EDT