SQLXML encoding setting



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

.


Loading