ooops, too fast too early. i copied the statement from textpad and ran it in qa, - that's why it worked. then i tried to run it with -i in osql and it croked with "Could not find stored procedure 'S'" message. i looked into the file with binary editor and noticed that you separate each character by null character.
Thanks the reply!
I could solve the problem, say by a crook method.
I was concerned about the two bytes at the start of any UNICODE file with WCHARs.
I used fwprintf to create an UNICODE file, and then feed this file as an input file to the osql CLI.
osql CLI was able to identify the input file as UNICODE file, because the start of file didn't had the FFFE signature.
Using fwrite.. I inserted FFFE at the start of the file and then used fwprintf
Now the File is acceptable to osql!