Invoke-SqlQuery Chinese is not supported
$data = Invoke-SqlQuery -query "SELECT * FROM someTable WHERE someCol = @var" -Parameters @{var = '你好'}
The above query statement cannot query the data
@Wangwang2021 -- the module does not do any manipulation of variables -- it sends them directly to the sql server via parameter bindings. I would suggest querying that column via the module and storing the value in a PS variable and comparing to what you are passing in. Something like this:
$val = Invoke-SqlScalar -query "SELECT someCol FROM someTable WHERE someID = 1"
$testVal = '' # the Chinese characters
# test to see if they are the same
$val -eq $testval
@Wangwang2021 -- the module does not do any manipulation of variables -- it sends them directly to the sql server via parameter bindings. I would suggest querying that column via the module and storing the value in a PS variable and comparing to what you are passing in. Something like this:
$val = Invoke-SqlScalar -query "SELECT someCol FROM someTable WHERE someID = 1" $testVal = '' # the Chinese characters # test to see if they are the same $val -eq $testval
thank 。Can you support querying directly based on Chinese parameters in the Sql statement?