Click here to Skip to main content
15,902,635 members
Home / Discussions / Database
   

Database

 
QuestionOpinion on how to handle a DataSet Pin
stormydaniels4-Nov-08 0:05
stormydaniels4-Nov-08 0:05 
AnswerRe: Opinion on how to handle a DataSet Pin
Wendelius4-Nov-08 4:53
mentorWendelius4-Nov-08 4:53 
QuestionConfigure Auto Database Replication Problem Using Sql Server 2000 Pin
veereshIndia3-Nov-08 18:55
veereshIndia3-Nov-08 18:55 
AnswerRe: Configure Auto Database Replication Problem Using Sql Server 2000 Pin
Wendelius4-Nov-08 5:05
mentorWendelius4-Nov-08 5:05 
QuestionDebugging a stored procedure Pin
dptalt3-Nov-08 10:29
dptalt3-Nov-08 10:29 
AnswerThis doesn't answer your question Pin
Ennis Ray Lynch, Jr.4-Nov-08 4:30
Ennis Ray Lynch, Jr.4-Nov-08 4:30 
AnswerRe: Debugging a stored procedure Pin
Wendelius4-Nov-08 5:18
mentorWendelius4-Nov-08 5:18 
QuestionCTE to Build XML Pin
Michael Vivet3-Nov-08 1:51
Michael Vivet3-Nov-08 1:51 
Hi
I have been experimenting with ways of extracting relational data in forms of xml from SQL Server 2005. I have created some views containg and ID integer field and a XML field. The ID field is what i filter on when selecting data, and the XML field contains the actual data.

I came across a situation where the XML data was recursive in its nature. I have a product Hierarchy where products consists of a list of SubProducts. I solved this by creating a SQL Function which is called recursively in my view, retreiving all products that have the current product as parent. Something Like this:

SELECT
ProductID,
ProductName,
ParentID,
dbo.GetSubProducts(ProductID)
FROM
view_Product

This worked fine with small amount of data, but ended up being very slow when there was a medium amount of data.

I tried refactoring my view to use CTE, cause it seems the way to go.
The problem is i get a folder like structure, and not a XML like structure.

Like this:
Product1
Product2
Product1/Product2
Product1/Product2/Product3
Product1/Product2/Product4
Product3
Product4

What I wanted was like this:
Product1/Product2/Product3+Product4
Product2/Product3+Product4
Product3
Product4

I want one row per product having all subproducts beneath it. A complete tree when looking at a specific product no matter the level in the hierarchy.

I have not posted any sql as i have no real solution to the issue.
I hope you understand the problm anyhow.

Michael
AnswerRe: CTE to Build XML Pin
Wendelius4-Nov-08 6:58
mentorWendelius4-Nov-08 6:58 
GeneralRe: CTE to Build XML Pin
Michael Vivet5-Nov-08 1:43
Michael Vivet5-Nov-08 1:43 
GeneralRe: CTE to Build XML Pin
Wendelius5-Nov-08 9:57
mentorWendelius5-Nov-08 9:57 
GeneralRe: CTE to Build XML Pin
Michael Vivet6-Nov-08 23:32
Michael Vivet6-Nov-08 23:32 
GeneralRe: CTE to Build XML Pin
Wendelius7-Nov-08 6:59
mentorWendelius7-Nov-08 6:59 
QuestionCheck if a table is empty Pin
ONeil Tomlinson2-Nov-08 22:36
ONeil Tomlinson2-Nov-08 22:36 
AnswerRe: Check if a table is empty Pin
Ashfield2-Nov-08 22:49
Ashfield2-Nov-08 22:49 
GeneralRe: Check if a table is empty Pin
SomeGuyThatIsMe4-Nov-08 7:46
SomeGuyThatIsMe4-Nov-08 7:46 
GeneralRe: Check if a table is empty Pin
Ashfield4-Nov-08 8:47
Ashfield4-Nov-08 8:47 
GeneralRe: Check if a table is empty Pin
SomeGuyThatIsMe4-Nov-08 9:25
SomeGuyThatIsMe4-Nov-08 9:25 
QuestionBackup database is terminating abnormally Pin
sunil goyalG2-Nov-08 20:26
sunil goyalG2-Nov-08 20:26 
AnswerRe: Backup database is terminating abnormally Pin
Eddy Vluggen3-Nov-08 0:14
professionalEddy Vluggen3-Nov-08 0:14 
GeneralRe: Backup database is terminating abnormally Pin
sunil goyalG3-Nov-08 1:09
sunil goyalG3-Nov-08 1:09 
AnswerRe: Backup database is terminating abnormally Pin
Eddy Vluggen3-Nov-08 1:35
professionalEddy Vluggen3-Nov-08 1:35 
GeneralRe: Backup database is terminating abnormally Pin
sunil goyalG3-Nov-08 1:52
sunil goyalG3-Nov-08 1:52 
GeneralRe: Backup database is terminating abnormally Pin
Eddy Vluggen3-Nov-08 2:05
professionalEddy Vluggen3-Nov-08 2:05 
GeneralRe: Backup database is terminating abnormally Pin
sunil goyalG3-Nov-08 2:13
sunil goyalG3-Nov-08 2:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.