473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Multi Value Values in Varchar field, to show each value separately in a view

Hi there

Got a interesting problem (depends on a point of view.....).

Background :-
Agent (within Domino) is run daily basis which extracts data from
Domino Notes application to SQL Server 2000 database. Agent first
removes ALL contents and then appends ALL data.

Reporting Tool is SQL Reporting Services (very cool !!).

Problem :-
Within Domino Notes, it can have a field which is mult-value field
i.e. contain multi values
e.g.

(from Helpdesk application)

!HowTo!!Access Email;
!HowTo!!Access the Web;
etc..

Need to create a view, then use sql to create stored proc, to be used
as the dataset for report within SQL Reporting services.

Format. (using above as data as example)

!HowTo!!Access Email; (1 row) WWL/SDR/04023/010 (
DocID)

!HowTo!!Access the Web; (2 row) WWL/SDR/04023/010 (
DocID)

I have a unique KEY within table called DocID. The report will have 8
separate datasets (i.e. using subreports), all linked back to Unique
Key. That's easy.

The dataset causing me hassle is the 1 above. How do u split out
values as separate rows ?

Name of field called --> "ImpFunctionsImpacted".

Also, notes expert, who's working on the agent, tell's me the data can
be split either as a comma or semi-colon.

Any suggestions most welcome.
Jul 20 '05 #1
2 1884
ImraneA (i.*****@weir.co.uk) writes:
Problem :-
Within Domino Notes, it can have a field which is mult-value field
i.e. contain multi values
e.g.

(from Helpdesk application)

!HowTo!!Access Email;
!HowTo!!Access the Web;
etc..
...
The dataset causing me hassle is the 1 above. How do u split out
values as separate rows ?


The best bet would be to write a table-valued function for the task.
Alas, in SQL2000, you can't use that in a query to unpack a table column
easily, but you would have to do some looping to do row by row.

On http://www.sommarskog.se/arrays-in-sql.html I discuss various ways
of unpacking delimited lists into tables. The functions in the article
may not work out of the box for you, but you should be able to adapt
them to your needs. Check also out the short section "Unpacking a Table
Column" which gives a few more ideas for this situation.

And if you feel that this becoming a whole lot of work, you are absolutely
right. This definitely not the way to store data relationally.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2
Thanks for comments. I follow it up..

Erland Sommarskog <es****@sommarskog.se> wrote in message news:<Xn**********************@127.0.0.1>...
ImraneA (i.*****@weir.co.uk) writes:
Problem :-
Within Domino Notes, it can have a field which is mult-value field
i.e. contain multi values
e.g.

(from Helpdesk application)

!HowTo!!Access Email;
!HowTo!!Access the Web;
etc..
...
The dataset causing me hassle is the 1 above. How do u split out
values as separate rows ?


The best bet would be to write a table-valued function for the task.
Alas, in SQL2000, you can't use that in a query to unpack a table column
easily, but you would have to do some looping to do row by row.

On http://www.sommarskog.se/arrays-in-sql.html I discuss various ways
of unpacking delimited lists into tables. The functions in the article
may not work out of the box for you, but you should be able to adapt
them to your needs. Check also out the short section "Unpacking a Table
Column" which gives a few more ideas for this situation.

And if you feel that this becoming a whole lot of work, you are absolutely
right. This definitely not the way to store data relationally.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: dbuchanan | last post by:
Hello, Here is the error message; ---------------------------- Exception Message: ForeignKeyConstraint Lkp_tbl040Cmpt_lkp302SensorType requires the child key values (5) to exist in the...
7
by: am72de | last post by:
Hi all, I've posted this problem some weeks ago, but noone had a solution. Perhaps now someone could help me. I have the following tables: Create Table T1 ( ID1 int Not Null , ID2 int Not...
2
by: feets | last post by:
OK first time poster, so hello everyone in advance. Right i'm sure this is a simple problem to solve, but I'm just getting the hang of SQL 2000. What I've got is a form where I input the values and...
15
by: gunnar.sigurjonsson | last post by:
I´m having some problem retrieving identity value from my newly inserted row into a view. I have two tables T1 and T2 which I define as following CREATE TABLE T1 ( id BIGINT GENERATED ALWAYS...
7
by: turtle | last post by:
I want to find out the max value of a field on a report if the field is not hidden. I have formatting on the report and if the field doesn't meet a certain criteria then it is hidden. I want to...
3
by: rahmawaktu | last post by:
Dear list, i am new to this forum and to JPGraph too. I just install jpgraph to create a graphic to my website. But i got error. Here is the complete code : First is MySQL Database : ( 2...
17
by: trose178 | last post by:
Good day all, I am working on a multi-select list box for a standard question checklist database and I am running into a syntax error in the code that I cannot seem to correct. I will also note...
5
by: Trevisc | last post by:
Happy Thursday Everyone, I am trying to create a parameter that is one long varchar but that will be used in a SQL statement IN function: //string queryString = GetCurrentTitles(); //Below is...
0
prabirchoudhury
by: prabirchoudhury | last post by:
CRITERIA; +-------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------------+--------------+------+-----+---------+-------+...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.