Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Stored Procedure XML Output to ASP?

Author  Topic 

Blastrix
Posting Yak Master

208 Posts

Posted - 2001-12-23 : 17:48:00
Okay, I have been looking all over, and I can find absolutely no way to get this to work. I created a stored procedure which returns the following XML in Query Analyzer:

<Ad AdId="1008" AdPosted="2001-12-19T22:48:56" Title="Anon Test" AdBody="The anonymous test"><Images ImageId="1"/></Ad>

This is just as it should be, but I can't for the life of me get this data into an MSXML2.DOMDocument to manipulate it as I need to. Does anyone have any experience with getting XML data from SQL Server to an ASP page?


Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2001-12-24 : 00:51:01
Hi

Man, I have done this in the last month...and have the code sitting at work.....but I'm on holiday...YAY...but that doesn't help you

I don't remember exactly what I did off the top of my head, but it was using a stream in ADO.

Here are some resources for you

www.sqlxml.org
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q272269

and I think there is some stuff on 4guysfromrolla.com too.

That should get you started, I would give you some code but I don't have it here.

Good luck

Damian
Go to Top of Page

Blastrix
Posting Yak Master

208 Posts

Posted - 2001-12-24 : 19:17:24
Is there any other way to do it, than what they show? I can't figure out how to use parameters with my stored procedures. Right now I do something like this:

 
sQuery = "<ROOT xmlns:sql='urn:schemas-microsoft-com:xml-sql'>"
sQuery = sQuery & "<sql:query>execute sp_SelectSomething</sql:query>"
sQuery = sQuery & "</ROOT>"


Do you just include the parameters as:

execute sp_SelectSomething @var1, @var2

Or is there a different way? All the examples I can find seem to deal with just writing an SQL query, rather than using a stored procedure.

Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2001-12-26 : 11:52:07
In general, yes you can just pass the parameters on the execute... line. I have not dealt with XML, so I don't know of any reason that it would be any different in terms of passing parameters.

Go to Top of Page
   

- Advertisement -