Wednesday, March 7, 2012

pass string to stored procedure

I have a table that has the follow format
PageID (integer)
Member_Id (varchar(20))
in my VB.net application, i have two strings that that take the following
format
Pages="2,2,3,4,4"
Members= "member1,member2,member3,member4,member5"
is there any way to pass the string variables to a stored procedure and
perform some type of insert into statement?
i would want to do something like this in a stored procedure
insert into AccessTablePages (Member_Id,PageID)
values (@.Members, @.Pages)You should be able to adapt the methods in Erland Sommarskog's article here:
http://www.sommarskog.se/arrays-in-sql.html
Steve Kass
Drew University
"Fabuloussites" <Fabuloussites@.discussions.microsoft.com> wrote in message
news:8EB1C476-23D7-4D56-9480-E69431317A46@.microsoft.com...
>I have a table that has the follow format
> PageID (integer)
> Member_Id (varchar(20))
> in my VB.net application, i have two strings that that take the following
> format
> Pages="2,2,3,4,4"
> Members= "member1,member2,member3,member4,member5"
> is there any way to pass the string variables to a stored procedure and
> perform some type of insert into statement?
> i would want to do something like this in a stored procedure
>
> insert into AccessTablePages (Member_Id,PageID)
> values (@.Members, @.Pages)
>|||Looks promising.
thanks1
"Steve Kass" wrote:

> You should be able to adapt the methods in Erland Sommarskog's article her
e:
> http://www.sommarskog.se/arrays-in-sql.html
> Steve Kass
> Drew University
> "Fabuloussites" <Fabuloussites@.discussions.microsoft.com> wrote in message
> news:8EB1C476-23D7-4D56-9480-E69431317A46@.microsoft.com...
>
>

No comments:

Post a Comment