Here'e the Stored Procedure,
USE [DataBaseName]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
Create PROCEDURE [dbo].[StoredProcedureName]
(
@listParameter varchar(8000) -- this is because SQL Server don't support "Max" --
)
AS
exec('SELECT *
FROM TableName
WHERE ColumnaName IN (' +@PasswordPolicyGroups+ ') -- checks for list of values --
and CoumnaNameB= 1')
List<String> myListData = GetListData(); // or your logic
string tempListData = string.Empty;
foreach(string data in myListData)
data += "'" + myListData + "',";
// now just pass data as your parameter and call stored procedure
string tempListData = string.Empty;
foreach(string data in myListData)
data += "'" + myListData + "',";
// now just pass data as your parameter and call stored procedure
No comments:
Post a Comment