SQLXML encoding setting
- From: "Zheka212" <egolyanov@xxxxxxxxx>
- Date: 22 Nov 2006 13:23:58 -0800
Hi Guys and Gals,
I use a simple vbscript inside of a DTS package to produce XML files.
Function Main()
Dim oCmd, sSQL, oDom
''' If MSXML 4.0 is not installed this will not work!
Set oDom = CreateObject("Msxml2.DOMDocument.4.0")
Set oCmd = CreateObject("ADODB.Command")
oCmd.ActiveConnection = "Provider=SQLOLEDB;Data
Source=mySQLServer;Initial Catalog=myDB;Integrated Security=SSPI"
sSQL = "<COUNTRY_LOOKUP><sql:query
xmlns:sql='urn:schemas-microsoft-com:xml-sql'>" & _
"SELECT " & _
"country_name = name_long " & _
", country_code = iso_country " & _
"INTO #MYTEMP " & _
"FROM countries c WITH (NOLOCK) " &_
"SELECT * FROM #MYTEMP COUNTRY_LOOKUP FOR XML
AUTO</sql:query></COUNTRY_LOOKUP>"
oCmd.CommandText = sSQL
oCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"
oCmd.Properties("Output Stream") = oDom
oCmd.Execute , , 1024
oDom.Save "c:\country_lookup.xml"
Main = DTSTaskExecResult_Success
End Function
Now, how do I go about adding the following line to this file?
<?xml version="1.0" encoding="iso-8859-1" ?>
Thanks in advance.
Eugene
.
- Follow-Ups:
- Re: SQLXML encoding setting
- From: Han
- Re: SQLXML encoding setting
- Prev by Date: RE: How can I replace a value in xml with .modify from the variable?
- Next by Date: Re: XSL transformation on XML data in SQL 2005 causes 'invalid character' error
- Previous by thread: Re: How can I concatenate fields XML in Yukon?
- Next by thread: Re: SQLXML encoding setting
- Index(es):
Loading