Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 BCPing of a timevalue into sql server datetime col

Author  Topic 

manikandan
Starting Member

35 Posts

Posted - 2001-05-03 : 03:01:04
The problem is with the BCPing in of a time (e.g.:08:00) into a SQL Server using character based BCP into a datetime field type. The datetime field is expecting both date and time (e.g.:05/02/2001 8:00) and produces an error when only the time is present in the data file. This appears to be a BCP issue since the SQL Server documentation specificies that it is perfectly legal to only supply the time and a default date will be assigned. This works fine performing an insert T-SQL command, but BCP inserts are not OK.

We have tried the bulk insert t-sql statement and it worked. The T-SQL command bypasses ODBC. We don't want this solution as a lot of batch programs needs to be changed.

Before we were using sybase server. Now we are migrating to SQL Server.The problem does not come with Sybase.

Any help will be appreciated.


Cheers
Manikandan
   

- Advertisement -