So we use osql to run in stored procedures as part of our build process. We use a project with an sp folder that gets published with applications as part of a build pack.
I used Visual Studio to create this project structure and created the sql scripts to run in the procs.
Visual Studio saved the files with UTF8 formatting (by default). osql when running in the scripts complained about every single script having a syntax error on line 1 i.e.
> Incorrect syntax near 'ยด'. 1> 2> Msg 102, Level 15, State 1,
> Server GBEPIAP-SQL01, Line 1
Rather baffling.
Anyway; to fix the issue, the sql scripts could be saved with Unicode Codepage 1200 (File -> Advanced Save Options)
et voila - problem gone
Now that's left me with an even bigger problem; I have over 200 proc scripts that I need to open, change encoding and save with the new encoding.
Can any powershell guru do me up a quick script to change the encoding of every file in a folder to Unicode Codepage 1200? Would be doing me a favour while also saving time.