Showing posts with label conflict. Show all posts
Showing posts with label conflict. Show all posts

Friday, March 30, 2012

Resolver Issues

I'm not able to resolve conflicts using the conflict viewer because I have
timestamp columns in my tables. Can I manually resolve these conflicts by
making the necessary changes to the data?
I'm using filters on my articles and I'm noticing that replication is
changing rows in the table that don't meet my filter clause. Well, all
the data didn't change in the row just the Last_Update_Date and
Last_Update_By columns changed. I have a trigger on my tables that
updates these columns. For some reason my trigger is getting fired.
These two columns get updated so replication thinks it needs to push these
changes along to the subscriber. I end up with conflicts if the
subscriber has also changed these rows.
The first thing to figure out is what is causing teh triggers to fire.
As far as manually doing this, you can. The conflict viewer is just another
application which sits over a set of data. You can easily do this yourself.
You can freely read/write to the conflict tables if you choose since the
only things which reads from them is the conflict viewer. If you choose,
you can write your own application to replace the conflict viewer in order
to fit it into your environment and tailor it to your needs.
Mike
Principal Mentor
Solid Quality Learning
"More than just Training"
SQL Server MVP
http://www.solidqualitylearning.com
http://www.mssqlserver.com
|||I figured out my trigger issue.
I appreciate your help.
"Michael Hotek" <mhotek@.nomail.com> wrote in message
news:O4wRnlLKEHA.620@.tk2msftngp13.phx.gbl...
> The first thing to figure out is what is causing teh triggers to fire.
> As far as manually doing this, you can. The conflict viewer is just
another
> application which sits over a set of data. You can easily do this
yourself.
> You can freely read/write to the conflict tables if you choose since the
> only things which reads from them is the conflict viewer. If you choose,
> you can write your own application to replace the conflict viewer in order
> to fit it into your environment and tailor it to your needs.
> --
> Mike
> Principal Mentor
> Solid Quality Learning
> "More than just Training"
> SQL Server MVP
> http://www.solidqualitylearning.com
> http://www.mssqlserver.com
>

Wednesday, March 28, 2012

Resolve conflict

Hi,

l've a raw data which contains list of device name and # of wires used, i.e.
DEVICE NAME # of Wires
-
A 10
B 11
C 17
D 5
A 0
E 0

So l would like to import these data into my table (with device name as primary key) which each device only appear once. If the device name appear twices, then l should ignore device with # of wires = 0. If device name appear twice and # of wires <> 0, then l should log it.

How should l do that in SSIS ?

1. Import the raw data

2. Put a MULTICAST into the pipeline.

3. Take Output1 from the MULTICAST and feed it into an AGGREGATE. Count the number of records per device name and sum the number of wires per device.

4. Us a conditional split to get all the devices where there is more than 1 record and the number of wires is greater than 0

5. Join that back to Output2 from the MULTICAST by using a MERGE JOIN, joining on device name.

6. Push the output from the MERGE JOIN into a flat file for later examination.

-Jamie

|||

I think there is an easier way to do this as long as there is no additional columns needed.

Source --> CS1 --> Agg --> CS2 --> Dest1

--> Dest 2

CS1 removes all items with # wires == 0 (e.g. expression on the output is # wires == 0 and then just don't attach this output and just attach the default output to Agg)

Agg then aggregates by name, does max (or min) on # wires and count

CS2 splits on count != 1, one output goes to the table (count == 1), and the other (count != 1) goes to either a script task that logs the info or a flat file that outputs the info.

This avoids MergeJoin and, therefore, a sort too.

HTH,

Matt