SQLserver2000 XML support! ! ! ! ! ! ! ! ! ! !

Category: MS-SQL Server -> Difficult Problems Author: whmyb Date: 2012-11-10 06:02:06
 
whmyb
2012-11-10 06:02:06
Heroes who used SQLserver2000 new xml data directly on the storage and querying capabilities.
Could pointing twelve.
I now want the database (2000server) direct readout data generated xml file. This file will be downloaded by parsing the client and then into the client database (may be any database system)
dreamhuoqian
2012-11-10 06:23:22
You can use
SELECT au_fname, au_lname FROM pubs .. authors for xml auto
SELECT au_fname, au_lname FROM pubs .. authors for xml auto, elements
...

Look to buy the book, the content too much
maxu35905
2012-11-10 06:50:11
1.you should install SQLXML3.0
2.IN SQL SERVER2K YOU CAN SEE sp_xml_preparedocument / sp_xml_removedocument.
3.SQLXML3.0 HAVE A LOT OF EXAMPLE.
FOR EXAMPLE:
Option Explicit
Sub main ()
Dim oTestStream As New ADODB.Stream
Dim oTestConnection As New ADODB.Connection
Dim oTestCommand As New ADODB.Command
oTestConnection.Open " ; provider = SQLXMLOLEDB.3.0; data provider = SQLOLEDB; data source = (local); initial catalog = Northwind; user id = UserName; password = UserPassword; "
oTestCommand.ActiveConnection = oTestConnection
oTestCommand.Properties ("ClientSideXML") = "True"
oTestCommand.CommandText = _
; "<ROOT xmlns:sql='urn:schemas-microsoft-com:xml-sql'>" & _
; "<sql:query>" & _
"SELECT FirstName, LastName FROM Employees FOR XML AUTO" & _
; "</ sql: query>" & _
; "</ROOT>"
oTestStream.Open
'You need the dialect if you are executing a template.
oTestCommand.Dialect = "{5d531cb2-e6ed-11d2-b252-00c04f681b71}"
oTestCommand.Properties ("Output Stream"). Value = oTestStream
oTestCommand.Properties ("Base Path"). Value = "c: \ Schemas \ SQLXMLWR2 \ New Folder \ ExecuteTemplateWithXSL \"
oTestCommand.Properties ("xsl"). Value = "myxsl.xsl"
oTestCommand.Execute,, adExecuteStream

oTestStream.Position = 0
oTestStream.Charset = ; "utf-8"
Debug.Print oTestStream.ReadText (adReadAll)
End Sub
Sub Form_Load ()
main
End Sub

The XSL template follows. The result of applying this XSL template is a two-column table.

<? xml version = '1 .0 'encoding =' UTF-8 '?>
< ; xsl: stylesheet xmlns: xsl = "
;
<xsl:template match ='Employees'>
<TR>
<TD> <xsl:value-of select ='@FirstName' /> </TD>
<TD> <B> <xsl: value-of select = '@ LastName' ;/> </B> </TD>
</TR>
< ;/ xsl: template>
<xsl:template match ='/'>
<HTML>
<HEAD>
<STYLE> th {background-color: # CCCCCC} </STYLE>
</HEAD>
<BODY>
< ; TABLE border = '1 'style =' width: 300; '>
<TR> <TH colspan='2'> Employees </TH> </TR>
<TR> ; <TH> First name </TH> <TH> Last name </TH> </TR>
<xsl:apply-templates select ='ROOT' />
< ;/ TABLE>
</BODY>
</HTML>
</ xsl: template>
</ xsl: stylesheet>

xiaojunjun111
2012-11-10 07:29:33
first through ado. net in the data on the dataset, and then call dataset of writexml method on the line
eggs520
2012-11-10 07:56:12
EXEC master .. xp_cmdshell 'bcp "SELECT au_fname, au_lname FROM pubs .. authors for xml auto "queryout c: \ DT.txt-c-Sdaliserver-Usa-Pelement '
a2550005188
2012-11-10 08:35:38
EXEC master .. xp_cmdshell' bcp" SELECT au_fname, au_lname FROM pubs .. authors for xml auto "queryout c: \ DT.txt-c-S database server-Usa-P password '
zchegdfgp8
2012-11-10 08:38:26
really do not know ah!
fsdfkhsj
2012-11-10 08:53:24
Learning to seriously study
azamature
2012-11-10 09:12:57
no contact, study, collection
xh861120
2012-11-10 09:16:24
I use asp.
Thank you heroes guidance. Sister to learn from it.
problem also please a lot of guidance.

raise another one. There have been no successful precedent Yeah.