I am writing update query
"Update tbl_List Set ListName = 'Hello' where ListId IN (stringArray()).
I have added 5 string values in stringArray() and how to pass it as input parameter to SQL ? How to execute query with Array values?
You can create your query as :
Update tbl_List Set ListName = 'Hello' where ListId IN ('value1' , 'value2' ,'valueN');
Or using a table :
Declare @Val Table (IDs Nvarchar(50) );
Insert into @val values ('value1'),('value2'),('valueN');
Update tbl_List Set ListName = 'Hello' where ListId IN (Select IDs From @Val);
You can loop in your StringArray to pass values , and you can use only one parametre and excute your query as much as the length of your Array.
Also you can use temp tables for that job.
ListIdis string?