Showing posts with label transactional. Show all posts
Showing posts with label transactional. Show all posts

Tuesday, March 27, 2012

duplicate rows in 1 csv file

Hi, I am trying to import data from a csv files to a OLE DB Destination. The csv files contains all transactional changes . For example for a particular record the firstname, lastname, email address records change within the same csv file. I need to save only the last updated record from the csv files. I have tried "slowly changing dimensions" but these dont work when there is duplictes within the same csv file. Also have tried 'Sort' but this only stores the first occurance.
Any ideas how i can store the latest changed data within 1 csv file.

How does the process distinguish between the latest data and duplicate data?

Is there a date as part of the row or is it just the last row wins?

Kirk Haselden
Author "SQL Server Integration Services"

|||the last row wins. there is no timestamp field . This is the way designed by the third party developers. Records are saved in csv files as changes are made. I have to put all these rows of data into a datawarehouse without duplicating the primary key.

Monday, March 26, 2012

Duplicate key row error in sql2000 transactional replication

HI All,
We have transactional replication(not updatable) between 2 databses on the
same server (sql server2000).
Our requiremnt is to prevent the deletes to go to subscriber db. So, while
setting up transactional replication entered NONE in article commands
properties tab for DELETE .
Now the deletes are not going to subscriber , but we are getting below error
for one table.
Cannot insert duplicate key row in object 'xx' with unique index 'PK_xx_x_xx'.
The structure of the table1 at the publisher:
Primary Key on xxxID column .
PRIMARY KEY (non-clustered)PK_xx_x_xx on xxxID column
The structure of the table at subscriber:
Index on xxxID
PK_xx_x_xx nonclustered, unique located on secondaryxxxID
The table does not have any clustered indexes defined.
Why we are getting this error? and How to solve this ? Thanks in advance
for your help.
Regards,
Suchi
You are probably getting a deferred update.
Have a look at http://support.microsoft.com/default.aspx/kb/238254
for more info.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Suchi" <Suchi@.discussions.microsoft.com> wrote in message
news:9934FEA4-DBBB-4DF4-B6F2-51D22E25A27E@.microsoft.com...
> HI All,
> We have transactional replication(not updatable) between 2 databses on the
> same server (sql server2000).
>
> Our requiremnt is to prevent the deletes to go to subscriber db. So, while
> setting up transactional replication entered NONE in article commands
> properties tab for DELETE .
> Now the deletes are not going to subscriber , but we are getting below
> error
> for one table.
> Cannot insert duplicate key row in object 'xx' with unique index
> 'PK_xx_x_xx'.
>
> The structure of the table1 at the publisher:
> Primary Key on xxxID column .
> PRIMARY KEY (non-clustered) PK_xx_x_xx on xxxID column
>
> The structure of the table at subscriber:
> Index on xxxID
> PK_xx_x_xx nonclustered, unique located on secondary xxxID
>
> The table does not have any clustered indexes defined.
> Why we are getting this error? and How to solve this ? Thanks in advance
> for your help.
> Regards,
> Suchi
>
>
|||Here is the fix http://support.microsoft.com/kb/302341/EN-US/
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Suchi" <Suchi@.discussions.microsoft.com> wrote in message
news:9934FEA4-DBBB-4DF4-B6F2-51D22E25A27E@.microsoft.com...
> HI All,
> We have transactional replication(not updatable) between 2 databses on the
> same server (sql server2000).
>
> Our requiremnt is to prevent the deletes to go to subscriber db. So, while
> setting up transactional replication entered NONE in article commands
> properties tab for DELETE .
> Now the deletes are not going to subscriber , but we are getting below
> error
> for one table.
> Cannot insert duplicate key row in object 'xx' with unique index
> 'PK_xx_x_xx'.
>
> The structure of the table1 at the publisher:
> Primary Key on xxxID column .
> PRIMARY KEY (non-clustered) PK_xx_x_xx on xxxID column
>
> The structure of the table at subscriber:
> Index on xxxID
> PK_xx_x_xx nonclustered, unique located on secondary xxxID
>
> The table does not have any clustered indexes defined.
> Why we are getting this error? and How to solve this ? Thanks in advance
> for your help.
> Regards,
> Suchi
>
>
|||Hi Hilary,
Thanks a ton for your reply. I have gone through the KB article , but that
is for single updtaes only. We are expecting multi row updates also.
Thanks,
Suchi
"Hilary Cotter" wrote:

> Here is the fix http://support.microsoft.com/kb/302341/EN-US/
> --
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Suchi" <Suchi@.discussions.microsoft.com> wrote in message
> news:9934FEA4-DBBB-4DF4-B6F2-51D22E25A27E@.microsoft.com...
>
>
|||Multi row updates are decomposed into single row updates. So if you update
100 rows as part of a batch or in a single stored procedure, they will be
replicated as 100 separate singleton updates.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Suchi" <Suchi@.discussions.microsoft.com> wrote in message
news:FCD2AFB5-4B5B-4DC9-BCA4-2C7AF2BB4871@.microsoft.com...[vbcol=seagreen]
> Hi Hilary,
> Thanks a ton for your reply. I have gone through the KB article , but that
> is for single updtaes only. We are expecting multi row updates also.
> Thanks,
> Suchi
> "Hilary Cotter" wrote: