0

I need to access array in SQL Server while using insert command. @slted has values like (1,2,3) these value is used to insert the no. of rows

alter proc usp_sltedAssign       
    @slted nvarchar, @curentMenuID bigint
as begin        
   insert into Table301 (FLD119,FLD232,FLD9)
   values('1', @curentMenuID, @slted)    
end

2 Answers 2

1

Create your array as an xml string, the use the XML functionality within SQL to parse out and insert into a table- or what ever you want to do

Sign up to request clarification or add additional context in comments.

Comments

0

The question is not very precise, but you might find what you're looking for by using TVPs.

Basically you can pass complete tables as parameters to queries, and then use them like normal table variables.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.