[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

shapper

3/28/2007 6:07:00 PM

Hello,

I am passing an NVarChar(MAX) parameter to a stored procedure.

This parameter contains tags separated by commas:
Tag1,Tag2,This is Tag 3,Just a Phrase, Last Tag

I need to create one record for each tag in table TAGS.

How can I do this?

Thanks,
Miguel

2 Answers

Alejandro Mesa

3/28/2007 6:28:00 PM

0

Arrays and Lists in SQL Server 2005
http://www.sommarskog.se/arrays-in-sql...


AMB


"shapper" wrote:

> Hello,
>
> I am passing an NVarChar(MAX) parameter to a stored procedure.
>
> This parameter contains tags separated by commas:
> Tag1,Tag2,This is Tag 3,Just a Phrase, Last Tag
>
> I need to create one record for each tag in table TAGS.
>
> How can I do this?
>
> Thanks,
> Miguel
>
>

TheSQLGuru

3/28/2007 9:22:00 PM

0

1) Use a parsing routine in CLR and a simple scripted insert with each
parsed value.

2) Use CHARINDEX and SUBSTRING TSQL commands to parse string input and again
have an INSERT Tags VALUES (..., @Tag)

--
TheSQLGuru
President
Indicium Resources, Inc.

"shapper" <mdmoura@gmail.com> wrote in message
news:1175105231.152827.74020@p77g2000hsh.googlegroups.com...
> Hello,
>
> I am passing an NVarChar(MAX) parameter to a stored procedure.
>
> This parameter contains tags separated by commas:
> Tag1,Tag2,This is Tag 3,Just a Phrase, Last Tag
>
> I need to create one record for each tag in table TAGS.
>
> How can I do this?
>
> Thanks,
> Miguel
>