How to declare arrray inside storedprocedure

Posted by Oswaldlily under ASP.NET on 6/4/2012 | Points: 10 | Views : 770 | Status : [Member] | Replies : 3
How to declare arrry inside storedprocedure

In codebehind
function.Storedprocedure1(_invoiceNo, _pNo[], _Query[],_flag);

In StoredProcedure

Alter Procedure Storedprocedure1
(
_invoiceNo as nvarchar(20),
_pNo as ? ,
_Query as ? ,
_flag as nvarchar(20)
)




Responses

Posted by: CGN007 on: 6/4/2012 [Member] Silver | Points: 25

Up
0
Down
http://www.codeproject.com/Articles/36394/Passing-an-Array-as-Parameter-to-SQL-Server-Proced
http://www.codeproject.com/Articles/17802/Use-Table-Valued-Functions-as-Arrays-in-SQL-Server

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/4/2012 [Member] Starter | Points: 25

Up
0
Down
if you using SQL Server 2008 and above , you can pass a data table to store procedure.

1st create a table type in sql server
Then use this new type as a readonly parameter.
and you can use this parameter.

and from dot not pass a datatable

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 6/23/2012 [Member] Silver | Points: 25

Up
0
Down
Mark as Answer if its helpful to you,that motivates...

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response