未正确执行使用Powershell特殊字符运行SQL脚本
我正在通过PowerShell运行sql脚本,它工作正常,但当存在此特定字符“ô”时,它将转换为此字符。 我如何解决这个问题?我正在附加下面的powershell代码 另外,我只能在powershell脚本中进行更改,我无法更改SQL脚本 PowerShell脚本未正确执行使用Powershell特殊字符运行SQL脚本,powershell,special-characters,sqlcmd,Powershell,Special Characters,Sqlcmd,我正在通过PowerShell运行sql脚本,它工作正常,但当存在此特定字符“ô”时,它将转换为此字符。 我如何解决这个问题?我正在附加下面的powershell代码 另外,我只能在powershell脚本中进行更改,我无法更改SQL脚本 PowerShell脚本 Invoke-sqlcmd -inputfile "C:\DailyPatch\extracted\CureMD.sql"-database $text[$i]-OutputSqlErrors $true|Out-File -fil
Invoke-sqlcmd -inputfile "C:\DailyPatch\extracted\CureMD.sql"-database $text[$i]-OutputSqlErrors $true|Out-File -filePath "C:\DailyPatch\dbname.txt"
检查您的CureMD.sql文件是否保存在UTF-8中。是否正确显示
ô
(带扬抑符的拉丁文小写字母O)在powershell_ise
?@DavidBrabant no its notTry:forceLucida Console
或Courier New
或(可下载)DejaVu Sans Mono
字体中运行脚本。如果未从cmd
继承,则相同的过程适用于Powershell
窗口。适用于Windows XP及以上版本。