Results 1 to 3 of 3

Thread: osql utility

  1. #1
    Join Date
    Jul 2004
    Posts
    34

    Unanswered: osql utility

    using osql utility i have converted a table in database to excel format. I have also chinese data in my database . The problem is while converting the data into excel format ,the chinese data is not comming in excel sheet.
    Does anybody have an idea about this .
    For converting i have used

    declare @x varchar(300)
    set @x = 'osql -S Servername -U username -P passwd -q "select * from northwind..region order by cand_index" -w 3000 -s "," -o C:\directory\filename.csv'


    Thanks

  2. #2
    Join Date
    Sep 2003
    Location
    KY
    Posts
    146

    Did

    Did you try using BCP instead and may be try using 950 codepage as a one of the switches . eg. -C950

    something like

    bcp "Select * from Northwind.dbo.region" queryout "D:\temp\filename.csv" -c -T -C950

    Use other switches to specify field seperator -t etc

    let know how it goes

    ...
    Last edited by aashu; 07-28-04 at 12:21.

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I would add a -u parameter to your OSQL command.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •