Im using sqlcmd in mssql to, create a action to move data from one structure to a other predefined database table. where both have the same collation
where i have some france colomn names. like: [numéro de la], if I do a select in the execute file. i get the result, i want. but do I do the same sql in the refered file, using “:r” it will die, whit a
Invalid column name ‘num�ro de la’.
execute.sql:
:setvar SrcDB [xxxx]
:setvar prefix [xxx]
:setvar StaDB [xx]
use $(StaDB)
select top 1 e.[numéro de la] FROM $(SrcDB).$(prefix).documents e
-- Common Paremeters
:setvar Path "C:file path"
:r $(Path)conv_xxx.sql
conv_xxx.sql
print 'test'
select top 1 e.[numéro de la] FROM $(SrcDB).$(prefix).documents e
when it is runned, it will show the result from the first select in the execute.exe fil, and print the ‘test’ message. And then show the error
“Invalid column name ‘num�ro de la’.“
Note, if i run conv_xxx.sql, whit the set var in the file, it just works.
i have been looking on google, but cant find any think on, how it make it load a file whit a the right format.
Im on a danish pc, so i think the problem is, when the “:r” action is getting the file, and reading it. it will do it in the wrong format. so once it loaded it have the � insted of é.
one fix, that whoud work, is to just make a function to replace/remove the é direct from the colomn name.
is there a way to force incoding of file ?
recap of problem:
“:r” loade file whit � insted of é