SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


XML Workshop XV - Accessing FOR XML results with ADO.NET


XML Workshop XV - Accessing FOR XML results with ADO.NET

Author
Message
jacob sebastian
jacob sebastian
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1056 Visits: 2523
I dont think FOR XML will give you better performance. FOR XML may not be used as a means to increase performance. It is usually used when an XML output need to be passed to the calling application.

If you have a slow running query, you should look at the execution plan to see what makes the query slow. The execution plan might tell what is causing the problem.

.
joern.bast
joern.bast
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 3
Hi All,
this article helps a lot to get an idea of solving my problems regarding sql-server data. my query looks like this:
SELECT
Company.UnternehmenName,
Company.UnternehmenID,
Department.Bereichname,
Department.BereichID,
Process.ProzessName,
Process.ProzessID,
SubProcess.SubProzessName,
SubProcess.SubProzessID
FROM Company

LEFT JOIN Department
ON Company.UnternehmenID = Department.BereichUnternehmenID
left JOIN Process
ON Department.BereichID = Process.BereichID
left join SubProcess
on Process.ProzessID = SubProcess.ProzessID
for xml auto,elements,type, ROOT('Company_Structure')

Anyhow the call of cmd.ExecuteXmlReader() runs into error. (InvalidOperationException)
What do I miss??
Regards Jörn
jacob sebastian
jacob sebastian
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1056 Visits: 2523
Does this query run on SSMS? It looks like there is something going wrong with the query and it is not returning an XML stream.

.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search