views:

545

answers:

2

SQL Server 2000 Guru's,

I've setup SQL 2000 to accept HTTP Queries i.e. http://74.22.98.66/MYDATABASE?sql={CALL+sp_XMLDATA}+&root=root (ficticious url) It works great and returns the following XML via I.E.7 url -

<?xml version="1.0" encoding="utf-8" ?> 
 <root>
  <g c="15" /> 
  <g c="8" /> 
  <g c="19" /> 
  </root>

However I also need to retrieve as return in the XML header "Content Length = 12345" i.e.

<?xml version="1.0" encoding="utf-8" "Content Length = 12345" ?> 
 <root>
  <g c="15" /> 
  <g c="8" /> 
  <g c="19" /> 
  </root>

How can I return "Content Length = 12345" via SQL 2000 http query?

FYI -

CREATE Procedure XML_Count

AS

DECLARE @Q_3_1_1 AS INT
DECLARE @Q_3_1_2 AS INT
DECLARE @Q_3_1_3 AS INT

CREATE TABLE #Temp1 (c INT, n INT)

INSERT INTO #Temp1 SELECT (select count(Q_3_1)   from  tblTEST  where Q_3_1 between 0 and .33) , (SELECT n = '1')
INSERT INTO #Temp1 SELECT (select count(Q_3_1)  from  tblTEST where Q_3_1 between .34 and .66) , (SELECT n = '2')
INSERT INTO #Temp1 SELECT (select count(Q_3_1)  from  tblTEST   where Q_3_1 between .64 and .99) , (SELECT n = '3')


SELECT c FROM #Temp1 AS g
ORDER BY n ASC

FOR XML AUTO
A: 

What I have found out: in common case content-length is not a XML header attribute, it's a HTTP field. Need more information:
Which technology are you using to retrieve XML data from SQL server?
Are there any troubles with large amounts of data transfers between SQL DB and your application?
Did you receive any error messages?

Max Gontar
Won't work on SQL 2000. xml datatype is SQL 2005 +
gbn
You right, I had to remove this solution.
Max Gontar
+1  A: 

This may be a job for XML Templates. When using a template you can control the header and make it exactly the way you want it.

magnifico