Answer the question
In order to leave comments, you need to log in
How to fix the problem with displaying comments in Cyrillic when creating a script through SMO Scripting?
Hello,
We use MS SQL Scripting to control changes in procedures, tables, functions in databases on MS SQL servers.
Due to production needs, we store everything in cp1251.
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | out-null
...
$scriptr = New-Object ('Microsoft.SqlServer.Management.Smo.Scripter')
...
$scriptr.Options.AnsiFile = $True
...
@Brief = 'BOARD',
@Name = '????? ??????',
Answer the question
In order to leave comments, you need to log in
Decision:
...
$scriptr.Options.Encoding = [System.Text.Encoding]::GetEncoding(1251)
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question