Showing posts with label replication. Show all posts
Showing posts with label replication. Show all posts

Sunday, February 19, 2012

bulk copy with an identity column

Hello,
I am using DB-Lib to bulk copy some data into a table that has an identity
column (set up to be used during replication). I don't think I want to
actually bind to an identity column with bcp_bind, do I? Is there any way t
o
skip that column?
Any help would be appreciated.
Ed Hoch
GEDDS Manager
Geophysical Institute
University of Alaska FairbanksHi
I have not used bulk copy and DB-lib, but I would expect that if the data is
included in the data file you still need to bind it but use 0 for the table
column see "Using a Data File with More Fields" in Books Online.
John
"Edward Hoch" <EdwardHoch@.discussions.microsoft.com> wrote in message
news:B4B4E323-3BD0-40BD-A9A0-734B1120A80F@.microsoft.com...
> Hello,
> I am using DB-Lib to bulk copy some data into a table that has an identity
> column (set up to be used during replication). I don't think I want to
> actually bind to an identity column with bcp_bind, do I? Is there any way
> to
> skip that column?
> Any help would be appreciated.
> Ed Hoch
> --
> GEDDS Manager
> Geophysical Institute
> University of Alaska Fairbanks
>|||Hi John,
Thanks for the reply. Unfortunately, it's not that my source data has
columns that I want to ignore, it's that my destination table has columns
that I want to "ignore", in the sense that the column holds uniqueidentifier
values that I don't know how to replace.
I guess I'll keep looking. Thanks again.
Ed
GEDDS Manager
Geophysical Institute
University of Alaska Fairbanks
"John Bell" wrote:

> Hi
> I have not used bulk copy and DB-lib, but I would expect that if the data
is
> included in the data file you still need to bind it but use 0 for the tabl
e
> column see "Using a Data File with More Fields" in Books Online.
> John
> "Edward Hoch" <EdwardHoch@.discussions.microsoft.com> wrote in message
> news:B4B4E323-3BD0-40BD-A9A0-734B1120A80F@.microsoft.com...
>
>|||Hi Ed
Translating from the BOL topic "Using a Data File with Fewer Fields" I would
expect the varlen to be -1 as well as the table_column being 0.
John
"Edward Hoch" <EdwardHoch@.discussions.microsoft.com> wrote in message
news:B23FF847-2610-4C30-8814-274CCEB63BD8@.microsoft.com...
> Hi John,
> Thanks for the reply. Unfortunately, it's not that my source data has
> columns that I want to ignore, it's that my destination table has columns
> that I want to "ignore", in the sense that the column holds
> uniqueidentifier
> values that I don't know how to replace.
> I guess I'll keep looking. Thanks again.
> Ed
> --
> GEDDS Manager
> Geophysical Institute
> University of Alaska Fairbanks
>
> "John Bell" wrote:
>|||One possibility you might want to try is to create a view on your
destination table that selects all columns except for the
uniqueidentifer column. You should then be able to bulk copy
directly into this view.

Thursday, February 16, 2012

Bulk Copy Errors

I am getting a "The process could not bulk copy into table '[dbo].[ ... "
error when attempting set up transactional replication between two SQL Server
2000 servers. The error occurs when copying the snapshot. The funny thing is
that the specific error states there is a primary key violation. However the
target table is empty and the source table does not contain any primary key
violations. Any ideas on what's causing this and how to address it?
Don't have a clue. I have never heard of this error before.
I'd try logging as per this kb article in hopes it can shed more light on
the matter.
http://support.microsoft.com/default...b;en-us;312292
Hilary Cotter
Looking for a SQL Server replication book?
Now available for purchase at:
http://www.nwsu.com/0974973602.html
"Dale" <Dale@.discussions.microsoft.com> wrote in message
news:6073D5C2-709B-441C-A62D-EB2182A3ADCF@.microsoft.com...
>I am getting a "The process could not bulk copy into table '[dbo].[ ... "
> error when attempting set up transactional replication between two SQL
> Server
> 2000 servers. The error occurs when copying the snapshot. The funny thing
> is
> that the specific error states there is a primary key violation. However
> the
> target table is empty and the source table does not contain any primary
> key
> violations. Any ideas on what's causing this and how to address it?