Quantcast
Channel: SQLServerCentral » Programming » Powershell » Latest topics
Viewing all articles
Browse latest Browse all 467

Umlauts in my TSQL script are turning to "?" when called from a powershell script

$
0
0
I am using a powershell script to manage releases over multiple servers & databases.when the tsql runs, umlauts are changing to question marks.an example:the powershell[code="other"]clear-host[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null$filepath = [Microsoft.VisualBasic.Interaction]::InputBox("Enter a Path name", "Release Tool 1.0", "C:\Temp\mysqlfile.sql")ForEach($item in (Get-ChildItem $filepath)) { Write-Output $item.FullName}invoke-sqlcmd -inputfile $filepath -serverinstance "<ServerName>" -database "tempdb"[/code]the tsql script[code="sql"]use tempdb goif exists (select name from sys.objects where object_id = object_id('PowershellTest'))begindrop table dbo.PowershellTestend gocreate table dbo.PowershellTest (StringValue varchar(64))go insert into dbo.PowershellTest(StringValue)select 'Gültig'go[/code]the results[code="sql"]select StringValue from dbo.PowershellTest[/code][code="other"]StringValueG?ltig[/code]Any help would be greatly appreciatedThanksIan

Viewing all articles
Browse latest Browse all 467

Trending Articles