ADO.NET - SQL sp Help please

J

jim

This sp works when I run it through debug in query analyzer but not when I
run it from VS server Explorer. Any idea what the difference is?

ALTER Procedure GetScores
@Key NVARCHAR(100)
AS
SELECT
1 AS TAG
,NULL AS PARENT
,NULL AS 'Results!1!Id'
,NULL AS 'Result!2!Trait'
,NULL AS 'Result!2!Score'
UNION
SELECT
2
,1
,NULL
,Trait
,SUM(Score)
FROM NewRes
WHERE (SessionID = @Key)
GROUP BY Trait
ORDER BY 'Result!2!Trait'
FOR XML EXPLICIT
Return
 
J

jim

I'm not calling this sp from code yet. I'm just testing it to see that I
get the results I want returned. I get the correct result when I run it
through SQL Query Analyzer but I dont get a result in the output window in
Visual studio when I run the sp through sever explorer. I will eventualy
pas the XML string into a chart control to display on an aspx page but I
need to get the XML string first.
 
M

Miha Markic

Hi,

jim said:
I'm not calling this sp from code yet. I'm just testing it to see that I
get the results I want returned. I get the correct result when I run it
through SQL Query Analyzer but I dont get a result in the output window in
Visual studio when I run the sp through sever explorer.

It is probably a limitation of server explorer.

I will eventualy
pas the XML string into a chart control to display on an aspx page but I
need to get the XML string first.

Try to access it within code. It should work.
You'll have to invoke SqlCommand.ExecuteXmlReader() method.
 
K

Kathleen Dollard

Jim,

You didn't tell us what happens.

Kathleen

jim said:
I'm not calling this sp from code yet. I'm just testing it to see that I
get the results I want returned. I get the correct result when I run it
through SQL Query Analyzer but I dont get a result in the output window in
Visual studio when I run the sp through sever explorer. I will eventualy
pas the XML string into a chart control to display on an aspx page but I
need to get the XML string first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top