[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference amcucs::ms-sqlsvr

Title:Microsoft SQL Server Support
Notice:Please Registar, Note #11
Moderator:AMCUCS::BETTS
Created:Tue Aug 23 1994
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:382
Total number of notes:1233

362.0. "SQLServer V6.5 bcp problem with "unimplemented data conversion"" by XSTACY::16.43.176.7::jlundon (It took Moses 40, it will take Tom only 4) Tue Apr 22 1997 05:52

I have a funny enough problem with SQL Server V6.5 and bcp that I've not
been able to track down.  I'm able to successfully "out" the particular
table from the database, but I have problems when putting the file back
"in" using the bcp command in a DOS box on my NT Workstation V4.0 SP2
build 1381 machine. 

The returned error is:

Explicit conversion from datatype 'int' to 'datatime' is current
unimplemented.

The table in question is as follows:

ENo - int
SNo - smallint
CId - int
CNo - varchar 25
CA - varchar 40
CL - varchar 25
CDate - datetime
MDate - datetime

I cannot seem to get a .fmt file that will suit bcp's "in" demands.  All
the other tables in my database have datetime columns too but none
exhibit this problem. 

Has anyone any idea what could be going wrong?  Do I need to provide
more information to better troubleshoot the problem.

Also, bcp, to me, seems very unwieldy to use.  I'm surprised that there
aren't better utilities - MS or third-party developed - that will allow
whole databases or tables to be transferred without having to worry about
internal formats etc..  Other DBMS vendors can do it, why can't MS? 

Many thanks,

James (having already spent too much time trying to get bcp working).

T.RTitleUserPersonal
Name
DateLines
362.1Proper address...XSTACY::16.43.176.7::jlundonReal e-address -> [email protected]Tue Apr 22 1997 05:556
My proper return address is [email protected] .

I don't seem to be able to get NetNotes to accept an "@"
in Options/Setup/Username :-(.

James.
362.2CSC32::HOEPNERA closed mouth gathers no feetTue Apr 22 1997 15:143
    
    What is your exact bcp statement? 
    
362.3More information on BCP problemXSTACY::16.43.176.7::jlundonReal e-address -> [email protected]Wed Apr 23 1997 02:4251
The BCP command is bog standard in the sense that I have no problems
using either /n or /c to extract the data and the fact that the command
line itself is fairly straightforward e.g. 

C:\> BCP DB..Table out .\table.bcp /n /S XXXXXX /U xx /P

Starting copy...

X rows copied
Network packet size (bytes): XXXX
Clock Time (ms.): total = XX Avg = XX (XX.XX rows per sec.)

or

C:\> BCP DB..Table out .\table.bcp /c /S XXXXXX /U xx /P

Starting copy...

X rows copied
Network packet size (bytes): XXXX
Clock Time (ms.): total = XX Avg = XX (XX.XX rows per sec.)

The problems only begin when I try an put the extracted file back into
the empty database table:

C:\> BCP DB..Table in .\Table.bcp /n /S XXXXXX /U xx /P
Msg 529, Level 16, State 1:
Server 'XXXXXX', Line 1:
Explicit conversion from datatype 'int' to 'datetime'  is currently
unimplemented.

or 

C:\> BCP DB..Table in .\Table.bcp /c /S XXXXXX /U xx /P
Msg 529, Level 16, State 1:
Server 'XXXXXX', Line 1:
Explicit conversion from datatype 'int' to 'datetime'  is currently
unimplemented.

I then dabbled a little with FMT files, with the same errors occurring
as before - the data was successfully extracted but could not be put
back into the database.  Is there a mechanism available that will allow
the data be stored in the BCP file via a FMT file that will allow for
its later successful insertion?

(I was unsuccessful finding a similar problem in either Dejanews or
COMET V4.2, so either the problem is extremely common or extremely rare
- hopefully the former for my sake.)

James.

362.4No defaults for the datetime columnsXSTACY::16.43.176.7::jlundonReal e-address -> [email protected]Thu Apr 24 1997 09:4310
It looks like the problem concerned the fact that I hadn't set
up any default values for the datetime column.  This resulted
in invalid data getting written to the BCP file and thereafter
problems getting it back into the database.  When getdate() was set
as a default in the column in question and BCP re-run, all worked
OK.

Thanks,

James.
362.5GUIDUK::HEALYAlan Healy @ZSOThu Apr 24 1997 16:1012
    I agree that bcp stands out as the most difficult tool in the SQL
    Server toolbox.  It's a holdover from the old Sybase days when
    character cell interfaces were standard.
    
    For what it's worth, I haven't seen a database system that has a sexy
    load utility - that seems to be low priority (after all, it never gets
    demo'd) - I worked quite a bit with Rdb's RMU/LOAD and it was the same
    story - poorly documented and difficult to work with.  There are 3rd
    party load utilities that probably are a little easier to use.
    
    	Al
    
362.6BCP is fine when You get it to work...STKHLM::KNORNI'm still hereTue May 06 1997 02:036
    
    I got tired of getting all these kind of nonsense messages and 
    accvios when loading data with bcp, so I created my own loading routine
    in order to get more control of the process.
    
    Stefan