using bcp for export query result to dbf file

  • hi all.

    I use this code for export query result to xls file:

    bcp "use MaliGilan0622; select * from test" queryout "c:\test.xls" -U sa -P pass -c -C RAW -k -E

    and this work fine.but I want to export query result to dbf file with bcp.what do I change to this code for my goal?I use this code too:

    INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'dBase IV;Database=C:\Temp;','select * from test1) select * from test

    but nvarchar fields show with ??? what do i do? please guide me.i search google very much but i don't find any thing.

  • bcp exports to text file. the fact that you name it xls means that excel will pick it up and reformat it as an xls file when you open it. Thus exporting to dbf is not possible with bcp.

    Why don't you try link server?

    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    Do not reinvent the wheel.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply