ODBC | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive


Hello I use command OSQL and i have in output file with strong character when i use the command xp_cmdshell
test.sql DECLARE @cmd sysname, @var sysname SET @var = ‘d:mssql7data’ SET @cmd = ‘dir ‘ + @var EXEC master..xp_cmdshell @cmd
I use this osql
osql -U sa -P GD6Dsa -S %SERVEUR% -i test.sql -o backup.log -b and the oupput file :backup.log there is stong character like ‘ÿ’ ,
WHY ? R‚pertoire de d:mssql7data NULL 12/09/03 12:05 <DIR> . 12/09/03 12:05 <DIR> .. 26/09/03 19:29 2ÿ097ÿ152 Coffre.ldf 26/09/03 19:29 2ÿ097ÿ152 Coffre.mdf 27/08/03 14:19 2ÿ886ÿ721 coffre.zip 16/09/03 14:05 1ÿ048ÿ576 Etiquettes_Data.MDF 16/09/03 14:05 12ÿ320ÿ768 master.mdf 16/09/03 14:05 5ÿ308ÿ416 mastlog.ldf 16/09/03 14:05 1ÿ048ÿ576 model.mdf 16/09/03 14:05 786ÿ432 modellog.ldf 16/09/03 14:05 8ÿ388ÿ608 msdbdata.mdf 16/09/03 14:05 786ÿ432 msdblog.ldf 16/09/03 14:05 1ÿ048ÿ576 northwnd.ldf 16/09/03 14:05 3ÿ801ÿ088 northwnd.mdf 16/09/03 14:09 112ÿ197ÿ632 oscar_Donn‚es.MDF 26/09/03 19:29 3ÿ879ÿ731ÿ200 oscar_Donn‚es2.MDF 26/09/03 19:29 112ÿ132ÿ096 oscar_Donn‚es3.MDF 16/09/03 14:09 1ÿ310ÿ720 oscar_Journal.LDF 26/09/03 19:29 1ÿ310ÿ720 oscar_Journal2.LDF 26/09/03 19:29 1ÿ310ÿ720 oscar_Journal3.LDF 16/09/03 14:05 1ÿ835ÿ008 pubs.mdf 16/09/03 14:05 786ÿ432 pubs_log.ldf 25/09/03 15:48 63ÿ176ÿ704 TEMPDB.MDF 16/09/03 14:47 786ÿ432 TEMPLOG.LDF 24 fichier(s) 4ÿ216ÿ196ÿ161 octets 491ÿ745ÿ280 octets libres
(31 lignes affect‚es)
What does a normal dir result look like (when done through cmd.exe) Looks like the separator used for 1000s of bytes is not a standard ascii character…? Cheers
It is a standard character. Remember that the output is not in the US English Locale – maybe French . The separator appears in the "Donn,es" data and log files instead of another character. There could be a code page issue between SQL Server, ODBC translation and Windows. Verify the consistency of this anomaly with other output that relies on ODBC and includes various punctuation characters. Nathan H.O.
Thank for your answer But we don t connect by odbc ;we use natif network sqlserver exit a way to check up the unicode ?