SQL Server 2000, "FOR XML AUTO" Request over http, Need "Content Length = 12345" in XML header header
SQL Server 2000 Guru,
I have set up SQL 2000 to accept HTTP requests i.e. http://74.22.98.66/MYDATABASE?sql= {CALL + sp_XMLDATA} + & root = root (ficticious url) It works fine and returns the following XML via IE7 url -
<?xml version="1.0" encoding="utf-8" ?>
<root>
<g c="15" />
<g c="8" />
<g c="19" />
</root>
However, I also need to get as return in the XML header "Content Length = 12345" ie
<?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 a SQL 2000 HTTP request?
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
This might be a job for XML templates . When using a template, you can control the title and make it exactly the way you want it.
source to share
What I found out: In general, content length is not an attribute of the XML header, it is an HTTP field . More Information Required:
What technology are you using to retrieve XML data from SQL Server?
Are there any problems with large amounts of data transfer between SQL DB and your application?
Have you received any error messages?
source to share