Is there a way to set the default to ANSI when saving the results to file
using SSMS in SQL 2005. it is saving as unicode by default.
thanksI couldn't find that on SQL Server 2000 or 2005 but below is the ActiveX
script I use to convert the file and save it as ANSI.
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim lobjStream
Dim lobjTarget
Dim lobjScript
Set lobjStream = CreateObject("ADODB.Stream")
Set lobjTarget = CreateObject("ADODB.Stream")
Set lobjScript = CreateObject("Scripting.FileSystemObject")
lobjStream.Open
lobjTarget.Open
lobjStream.charset = "unicode"
lobjStream.LoadFromFile "\\MYSERVER\D$\FileDirectory\MyFile.txt"
lobjTarget.charset = "X-ANSI"
lobjStream.CopyTo lobjTarget
lobjTarget.SaveToFile "\\MYSERVER\D$\FileDirectory\MyFile2.txt"
'Clean Up
lobjStream.Close
Set lobjStream = Nothing
lobjTarget.Close
Set lobjTarget = Nothing
lobjScript.CopyFile "\\MYSERVER\D$\FileDirectory\MyFile2.txt",
"\\MYSERVER\D$\FileDirectory\MyFile.txt", True
lobjScript.DeleteFile "\\MYSERVER\D$\FileDirectory\MyFile2.txt", True
Set lobjScript = Nothing
Main = DTSTaskExecResult_Success
End Function
"Dev" wrote:
> Is there a way to set the default to ANSI when saving the results to file
> using SSMS in SQL 2005. it is saving as unicode by default.
> thanks
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment