Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- From: just55 <hvmallick@xxxxxxxxx>
- Date: Thu, 19 Jun 2008 10:15:11 -0700 (PDT)
On Jun 19, 10:19 am, Erland Sommarskog <esq...@xxxxxxxxxxxxx> wrote:
just55 (hvmall...@xxxxxxxxx) writes:
My confusion is - if these data values are duplicate, how can the
primary key exist in the source 6.5 database ??
Or, am I missing to copy the datetime data properly from Sql 6.5 to
Sql 2000 with bcp out/in ?? Is there any other option for me to copy
the source table with the constraints etc as it is to the target Sql
2000 instance..?
It sounds a bit mysterious, but permit me to start with a known gotcha.
Which BCP do you use to BCP out, and which format do you use?
If you use BCP 6.5 and character format, be aware of that BCP 6.5 will give
you only hours and minutes. If there are datetime values with differences
in seconds and milliseconds only, this could explain the PK errors.
There are two alternative ways to preserve seconds and milliseconds. One if
to use native format. However, if you have columns of the sysname data type,
this will fail, since the definition of this type is different in SQL 2000.
The other alternative is to use BCP 2000 to get the data from SQL 6.5.
Then you can still use character format.
--
Erland Sommarskog, SQL Server MVP, esq...@xxxxxxxxxxxxx
Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Hi,
Thanks for the reply. I am using BCP 6.5 with character mode. As you
pointed out, it may not be copying the seconds/milli seconds info to
the target.
The table does not have any sysname datatype. I tried BCP from sql 6.5
to Sql 2000 with the native mode as you suggested, but got the
following error:
Starting copy...
SQLState = 22001, NativeError = 0
Error = [Microsoft][ODBC SQL Server Driver]String data, right
truncation
SQLState = 22001, NativeError = 0
I checked that both the source and target tables have the same
columns, datatypes and lengths.
Not sure here about the error.
You suggested the second alternative for BCP 2000 to get the data from
SQL 6.5..
Would you please elaborate how this can be achieved..
Thanks a lot!!
Regards,
Himansu
.
- Follow-Ups:
- Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- From: Erland Sommarskog
- Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- References:
- Issue with date move from Sql 6.5 to Sql 2000 using bcp
- From: just55
- Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- From: Erland Sommarskog
- Issue with date move from Sql 6.5 to Sql 2000 using bcp
- Prev by Date: Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- Next by Date: Re: SQL Server Enterprise Manager Error
- Previous by thread: Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- Next by thread: Re: Issue with date move from Sql 6.5 to Sql 2000 using bcp
- Index(es):
Relevant Pages
|