Showing posts with label merge. Show all posts
Showing posts with label merge. Show all posts

Tuesday, March 27, 2012

Can not drop merge replication.

Hi, i have a publisher running sql server 2000 sp3. I have
configured a merge replication with two push
subscriptions. I need to delete the subscriptions and the
publication but when i try to do it, i get this error:
Error 207: invalid column name 'enabled_for_syncmgr'
I'll really appreciate your help because i need to remove
replication from this database.
Regards,
Maria,
try running sp_helpsubscription @.publication = 'publication' , @.article =
'article'.
For each one found, run sp_dropmergesubscription, then drop the publication.
If it errors, please state at which point, and any relevant data from
sp_helpsubscription.
Regards,
Paul Ibison
|||Thanks a lot for your help. Yesterday i tryed to disable
this database for merge publications and it displays the
same error.
After that I execute the procedure you recommend me. Today
I found that the database is not configured for
replication but i still see the publication and
subscriptions in the replication monitor. The snapshot and
the subscriptions are failed displaying:
"The 'databasename' database is not published for merge
replication. "
And the subscribers displays:
"Publication 'publicationname' does not exists. The step
fails."
If i try to delete the publication diplays this error:
"Error: 21776. [SQL-DMO]The name 'publicationname' was not
found in the mergepublications collation..."
What should I do to delete the publication and subscribers
from the replication monitor?
Thanks a lot for your help.

>--Original Message--
>Maria,
>try running sp_helpsubscription @.publication
= 'publication' , @.article =
>'article'.
>For each one found, run sp_dropmergesubscription, then
drop the publication.
>If it errors, please state at which point, and any
relevant data from
>sp_helpsubscription.
>Regards,
>Paul Ibison
>
>.
>
|||Maria,
if you're lucky, this database is not needed to be used for replication as a publisher or subscriber. In this case you can run
sp_removedbreplication 'dbname'.
If not, then I'd script out what you need, remove what you can using hte replication interface in EM, then run the script above because there are some corrupted system table records which are better removed. Subsequently you can readd your scripts. Depend
ing on your replication you may be able to resume replication without reinitializing the data. Anyway, hopefully this is academic and you can simply run the command above on its own.
HTH,
Paul Ibison

Sunday, March 11, 2012

Can merge replication be used to keep two database in sync

Hello, I have situation as followed. Do you think merge replication would
be able to keep both databases in sync?
We have two databases (a primary and a secondary)
Regular users use the primary database. To keep the secondary data in sync
with the primary, I have a job running everyday to copy and replace the
tables
and data in the secondary database.
Assuming the primary database is offline and users use the secondary. And
users update/add to the secondary database. Now, the primary database is
back on line. How should I plan to sync the secondary database data
with the primary? Can it be done by merge replication? Can merge
replication
be setup so if there is update in the primary, the secondary will be update.
And when there is update in the secondary, the primary will be updated?
What to setup so both copies of the database have the same data if
I want them to have the same data all the time?
Thanks,
Q
Q,
there was a thread on this last week answered by me, Hilary and Mike Hotek
called 'add a field'. This is a big topic and there are many angles. You
might consider:
transactional replication with queued updating subscribers,
database mirroring and
merge replication.
Each has its pros and cons - largely covered in the thread mentioned above.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||You can add transactional with immediate updating, bi-directional
transactional, and peer-to-peer transactional since this question is a more
general case and doesn't specify versions or editions.
200 - 300 pages later, you would still wind up with the answer of it
depends. All of them will work, but it depends upon lots of things in your
environment to be able to decide one way or the other.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:%23uWY0KUGGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Q,
> there was a thread on this last week answered by me, Hilary and Mike Hotek
> called 'add a field'. This is a big topic and there are many angles. You
> might consider:
> transactional replication with queued updating subscribers,
> database mirroring and
> merge replication.
> Each has its pros and cons - largely covered in the thread mentioned
> above.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||Mike,
I would not include transactional with immediate updating in this mix. If
the primary server is down, the poster wants to be able to use the secondary
one, and the inability to do a 2PC will prevent any changes being made on
the subscriber in this case.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Further note that bi directional replication is not really scalable due to
no conflict mechanism; peer-to-peer is not scalable beyond 12-15 nodes.
Updateable subscription types are best when the majority of DML occurs on
the publisher. Updateable Subscriptions allow conflicts to be logged but not
rolled back.
Merge replication is scalable to 1,000 or subscribers, it has a rich
conflict detection and resolution mechanism, and there is no restriction
with where the majority of DML occurs.
Hilary Cotter
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
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:u%23sNLR0GGHA.1192@.TK2MSFTNGP11.phx.gbl...
> Mike,
> I would not include transactional with immediate updating in this mix. If
> the primary server is down, the poster wants to be able to use the
> secondary one, and the inability to do a 2PC will prevent any changes
> being made on the subscriber in this case.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>
|||That's really baffling. Those are some pretty absolute numbers being thrown
around. How does conflict detection have anything at all to do with
scalability?
If I want to, I can build a bi-directional transactional configuration in a
linear chain that has 1000 servers in it and make it work perfectly fine, so
that blows your "can't scale" theory out of the water, because it can in
fact be done. (Although I don't have an explicit business application for
that.)
How do you figure that peer-to-peer is not scalable beyond 12 - 15 nodes?
Just what exactly was your test platform that gave you those explicit
numbers. I'd really like to know, because my testing has taken it out to 30
nodes and everything was still working.
I've done updating subscribers in configurations where not only where there
dozens of subscribers, but over 90% of the changes occured on the
subscribers.
There is no such thing as rolling back from a conflict. A rollback occurs
within a transaction space and causes changes to be undone before they are
committed to the database. A conflict is thrown against committed and
completely valid data in the database. The only thing that conflict
resolution can do is produce a compensating transaction which is then
applied, but it is still a completely separate transaction that modifies
data. (It most certainly doesn't rollback.)
Merge is scalable to 1000 subscribers? Really. How do you figure? I've
had a merge architecture in place and running perfectly fine since SQL
Server 7.0 that had over 10,000 subscribers in the architecture. I've also
had merge architectures which couldn't scale beyond 5 subscribers.
I really like these nice blanket statements being thrown out. Particularly
since they have zero basis in reality. The reality of replication is that
scalability has a direct correspondence to the volume of data per unit time
that is being sent through the engine. It has ZERO correspondence to the
number of subscribers or the pattern of modifications. When you say "does
not scale beyond x", that means it plain and simply does not work if you try
it. That is obviously a completely false statement, because you can ALWAYS
get something to scale beyond x.
Keep in mind there are a LOT of people out here reading this. When you say
that a technology can't scale beyond X, then people are going to start
looking for different tecnologies to apply, because according to you, the
replication engine can't meet their business requirements. It also makes it
really difficult for SQL Server DBAs to architect systems, because their
managers point to your posts which say that SQL Server can't do what they
are proposing to do and no amount of testing is going to change their minds
once they've decided. So, how about giving the people who wrote the code
for the replication engine a break and if you are going to post a
scalability number, back it up with enough information to explicitly define
the entire environment that drew that conclusion.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eqHw513GGHA.1388@.TK2MSFTNGP11.phx.gbl...
> Further note that bi directional replication is not really scalable due to
> no conflict mechanism; peer-to-peer is not scalable beyond 12-15 nodes.
> Updateable subscription types are best when the majority of DML occurs on
> the publisher. Updateable Subscriptions allow conflicts to be logged but
> not rolled back.
> Merge replication is scalable to 1,000 or subscribers, it has a rich
> conflict detection and resolution mechanism, and there is no restriction
> with where the majority of DML occurs.
> --
> Hilary Cotter
> 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
> "Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
> news:u%23sNLR0GGHA.1192@.TK2MSFTNGP11.phx.gbl...
>
|||Most of my figures come from a recent presenation that Phil Vaughn did at
Pass this year on replication. I'll listen to it again and verify these
numbers. If I am incorrect I will post back here with the corrections. I'll
also ping him to verify these quotes. Paul Ibison has a copy of the same
presentation.
While I have no doubt that you have built such systems let me quote from BOL
In a section entitled Queued Updating - Queued updating is most appropriate
for applications where users mostly read data and only occasionally update
data.
In a section entitled Immediate Updating - . Immediate updating benefits
applications in which snapshot or transactional publications are preferred
but occasional updates need to be made at the Subscriber.
While BOL has occasionally being inaccurate, it is my belief and experience
that it is completely correct here.
When I say something is rolled back, I mean it in the same sense a
transaction is rolled back and the system is left in the state is was in
before. You can use the conflict viewer to "rollback" replication changes,
or as they put it "keep the Wining Change", resubmit delete, insert, update.
Note that in SQL 2000 you have an option to compensate for errors which had
a default of false. In SQL 2005 it has a default of true. In other words
conflicts will be logged but the changes will not win on the subscriber with
this setting as false.
As I have stated previously in this newsgroup Paul and I have a committment
to accuracy and helping people with correct information. I trust you have
the same committment.
Hilary Cotter
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
"Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
news:OFKLzQ6GGHA.2696@.TK2MSFTNGP14.phx.gbl...
> That's really baffling. Those are some pretty absolute numbers being
> thrown around. How does conflict detection have anything at all to do
> with scalability?
> If I want to, I can build a bi-directional transactional configuration in
> a linear chain that has 1000 servers in it and make it work perfectly
> fine, so that blows your "can't scale" theory out of the water, because it
> can in fact be done. (Although I don't have an explicit business
> application for that.)
> How do you figure that peer-to-peer is not scalable beyond 12 - 15 nodes?
> Just what exactly was your test platform that gave you those explicit
> numbers. I'd really like to know, because my testing has taken it out to
> 30 nodes and everything was still working.
> I've done updating subscribers in configurations where not only where
> there dozens of subscribers, but over 90% of the changes occured on the
> subscribers.
> There is no such thing as rolling back from a conflict. A rollback occurs
> within a transaction space and causes changes to be undone before they are
> committed to the database. A conflict is thrown against committed and
> completely valid data in the database. The only thing that conflict
> resolution can do is produce a compensating transaction which is then
> applied, but it is still a completely separate transaction that modifies
> data. (It most certainly doesn't rollback.)
> Merge is scalable to 1000 subscribers? Really. How do you figure? I've
> had a merge architecture in place and running perfectly fine since SQL
> Server 7.0 that had over 10,000 subscribers in the architecture. I've
> also had merge architectures which couldn't scale beyond 5 subscribers.
> I really like these nice blanket statements being thrown out.
> Particularly since they have zero basis in reality. The reality of
> replication is that scalability has a direct correspondence to the volume
> of data per unit time that is being sent through the engine. It has ZERO
> correspondence to the number of subscribers or the pattern of
> modifications. When you say "does not scale beyond x", that means it
> plain and simply does not work if you try it. That is obviously a
> completely false statement, because you can ALWAYS get something to scale
> beyond x.
> Keep in mind there are a LOT of people out here reading this. When you
> say that a technology can't scale beyond X, then people are going to start
> looking for different tecnologies to apply, because according to you, the
> replication engine can't meet their business requirements. It also makes
> it really difficult for SQL Server DBAs to architect systems, because
> their managers point to your posts which say that SQL Server can't do what
> they are proposing to do and no amount of testing is going to change their
> minds once they've decided. So, how about giving the people who wrote the
> code for the replication engine a break and if you are going to post a
> scalability number, back it up with enough information to explicitly
> define the entire environment that drew that conclusion.
> --
> Mike
> http://www.solidqualitylearning.com
> Disclaimer: This communication is an original work and represents my sole
> views on the subject. It does not represent the views of any other person
> or entity either by inference or direct reference.
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:eqHw513GGHA.1388@.TK2MSFTNGP11.phx.gbl...
>
|||The presentation is #336 - SQL Server 2005 Replication: Lesson's learned
from Early Adopters, in a slide entitled Peer to Peer Topology, in response
to an inaudible question, Phil has this to say "Realistically speaking when
once you get to about 10-12, you start sending around so many changes you
get to a point of diminishing returns, but about 10-12 nodes is where it
peaks out, cause all changes flow everywhere."
The transcription is mine. You can order this cd from the pass website. I
suggest you follow up with Phil if you have more questions about his remarks
or figures. If you are able to make this scale out to 30 servers I am sure
Microsoft would be very interested in speaking with you.
Phil also says (another quote from the same slide) in reference to
bi-directional transactional replication - "it supported one node, and two
nodes, but you couldn't extend it beyond 2."
If you want to contact me I can play these sound clips for you. I can
contact Kevin Kline president of Pass and ask him for permission to publish
the audio's for these slides if you require it, but I urge you to contact
Phil or to follow up with your Microsoft contacts.
Hilary Cotter
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
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:uIq8356GGHA.3100@.tk2msftngp13.phx.gbl...
> Most of my figures come from a recent presenation that Phil Vaughn did at
> Pass this year on replication. I'll listen to it again and verify these
> numbers. If I am incorrect I will post back here with the corrections.
> I'll also ping him to verify these quotes. Paul Ibison has a copy of the
> same presentation.
> While I have no doubt that you have built such systems let me quote from
> BOL
> In a section entitled Queued Updating - Queued updating is most
> appropriate for applications where users mostly read data and only
> occasionally update data.
> In a section entitled Immediate Updating - . Immediate updating benefits
> applications in which snapshot or transactional publications are preferred
> but occasional updates need to be made at the Subscriber.
> While BOL has occasionally being inaccurate, it is my belief and
> experience that it is completely correct here.
> When I say something is rolled back, I mean it in the same sense a
> transaction is rolled back and the system is left in the state is was in
> before. You can use the conflict viewer to "rollback" replication changes,
> or as they put it "keep the Wining Change", resubmit delete, insert,
> update.
> Note that in SQL 2000 you have an option to compensate for errors which
> had a default of false. In SQL 2005 it has a default of true. In other
> words conflicts will be logged but the changes will not win on the
> subscriber with this setting as false.
> As I have stated previously in this newsgroup Paul and I have a
> committment to accuracy and helping people with correct information. I
> trust you have the same committment.
> --
> Hilary Cotter
> 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
> "Michael Hotek" <mike@.solidqualitylearning.com> wrote in message
> news:OFKLzQ6GGHA.2696@.TK2MSFTNGP14.phx.gbl...
>
|||Thanks, you don't have to. I don't need the slides. I know exactly what is
being said. It also isn't an absolute statement. When you say "doesn't
scale" or something else to that effect, to me it means it physically can
NOT be done as in the engine blows up, throws error messages, prevents you
from doing it etc.
While BOL may say that it was designed for a particular application, that
doesn't mean it can't be used for something else. The merge engine
certainly wasn't designed for 500GB+ databases when it released in 7.0, but
it was certainly done. The queued updating option had an original design
spec for scenarios where most of the updates happened at the subscriber, but
more than 90% of the implementations I've put in (numbering in the over 100
implementations category) had nearly 100% of the changes occuring at the
subscriber. So, there are hundreds of cases that I've personally done which
disagree significantly with BOL. I also have several queued updating
architectures with more than 50 subscribers which again disagrees with your
absolute numbers.
As far as peer-to-peer goes, it really depends upon what you are doing and
what you are running on. On a quad processor Xeon, I had a hard time
getting 6 of them running where I had 100 or so changes per minute going in
the system. If I chopped that down to 50 changes per minute, I could double
the number of subscribers before it started slowing down. If I changed from
Windows 2000 to Windows 2003, I could add a couple more. If I moved it to a
quad, dual core, Opteron, I shoved it for 30 in a peer-to-peer architecture
with about 50 changes per minute going on before it started to bog down. If
I increased it to 200 per minute, I had to chop out ~1/4 of the subscribers.
If I moved from issuing the transactions against a 30 column table to doing
it against a 5 column table, I could shove it up to about 400 changes per
minute before it started to bog down. So, the number are VERY HIGHLY
DEPENDENT upon precisely what you are doing.
If you are going to post numbers, particularly with the replication engine,
I am ALWAYS going to dispute them. (Plain and simply because since way back
in SQL Server 6.5, I've had implementations in production that have ALWAYS
exceeded any type of numbers Microsoft has posted and have ALWAYS had
implementations doing things that a feature wasn't originally designed to
do.) You had better be prepared to explicitly specify:
1. OS version
2. OS configuration
3. Hardware config
4. SQL Server version
5. SQL Server config
6. Network infrastructure
7. Network bandwidth statistics
8. Database structure
9. Write activity
a. Volume broken down by inserts, updates, and deletes
b. Broken down by transaction per minute
c. Broken down by transaction pattern
10. Replication method
11. Replication config
If you aren't meeting at least those set of requirements, any numbers that
are posted are VERY BASIC rules of thumb at the very least and most
definitely do not impose limitations or prevent you from surpassing them.
They most definitely are not meant to be thrown around as absolute barriers
to doing something. If the interest is in being accurate, then any time
numbers are posted, they certainly should not be posted in these 1 and 2
sentence blurbs that convey the meaning that if you are looking to exceed
those numbers, you had better look at some other technology because the
replication engine can't do X.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
"Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
news:eZe%23ZE%23GGHA.3752@.TK2MSFTNGP11.phx.gbl...
> The presentation is #336 - SQL Server 2005 Replication: Lesson's learned
> from Early Adopters, in a slide entitled Peer to Peer Topology, in
> response to an inaudible question, Phil has this to say "Realistically
> speaking when once you get to about 10-12, you start sending around so
> many changes you get to a point of diminishing returns, but about 10-12
> nodes is where it peaks out, cause all changes flow everywhere."
> The transcription is mine. You can order this cd from the pass website. I
> suggest you follow up with Phil if you have more questions about his
> remarks or figures. If you are able to make this scale out to 30 servers I
> am sure Microsoft would be very interested in speaking with you.
> Phil also says (another quote from the same slide) in reference to
> bi-directional transactional replication - "it supported one node, and two
> nodes, but you couldn't extend it beyond 2."
> If you want to contact me I can play these sound clips for you. I can
> contact Kevin Kline president of Pass and ask him for permission to
> publish the audio's for these slides if you require it, but I urge you to
> contact Phil or to follow up with your Microsoft contacts.
> --
> Hilary Cotter
> 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
> "Hilary Cotter" <hilary.cotter@.gmail.com> wrote in message
> news:uIq8356GGHA.3100@.tk2msftngp13.phx.gbl...
>

Saturday, February 25, 2012

Can I use Merge Replication via Developer Edition to Cluster?

I am a DBA in one IT group and we do our development work on the developer
edition of SQL Server 2005 and migrate everything to our SQL Server 2005
cluster for production.
We want to use merge replication between the Developer Edition and the
Cluster but I am being told by the DBA on the cluster that:
1. The developer edition of SQL Server does not have the same features as
the enterprise edition; that the enterprise edition is required for
implementing the SQL Cluster as this is not featured in the developers
edition.
This statement seems to conflict with what Microsoft has posted online at ...
http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
"SQL Server 2005 Developer Edition and Evaluation Edition are not listed in
the tables. These editions have the same feature set as the Enterprise
Edition; the only difference between these editions is the licensing
policies."
2. That reporting services in the developers edition has limitations which
requires you to upgrade to the standard or enterprise edition in order to
take advantage of all the bells and whistles for this product. Our DBA sats
the developer edition is just that, a developers editio,n and which is
normally used for testing before implementing to standard or enterprise
editions of SQL Server.
3. That replicating data from a developers edition to the enterprise edition
of SQL Server Cluster is not supported by Microsoft, thus if issues arise
Micorsoft will not support this setup.
So does anyone if there's any truth to our inability to do merge replication
from the Developer Edition to the Cluster?
Thanks!
You need a new dba.
1) The developer edition supports all of the features of the Enterprise
Edition. There may be a limitation on the number of subscribers you can have
to a publication, but if there is it is not documented.
2) I am not sure about this one, but I don't think it is correct. You would
need to post to the reporting services group for more information.
3) This might be a licensing issue. The developer edition is intended for
development only. You will be able to replicate to a cluster running SQL
Server 2005 EE. When it comes to licensing issues you may have to
demonstrate licensing for auditors, but CSS will help you with problems you
may encounter while running this.
Keep in mind the developer edition is for development, not production.
Should you be replicating to production it should be a one time or
occasional occurrence as part of your development process, and not part of a
production topology.
That been said I have set up replication to development environments from a
production environment many times. I did not configure the licensing but I
am confident it was legit.
HTH
Hilary Cotter
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
"Robert Reist" <RobertReist@.discussions.microsoft.com> wrote in message
news:0D620D0B-4432-4377-A2CD-C92C62C29EDE@.microsoft.com...
>I am a DBA in one IT group and we do our development work on the developer
> edition of SQL Server 2005 and migrate everything to our SQL Server 2005
> cluster for production.
> We want to use merge replication between the Developer Edition and the
> Cluster but I am being told by the DBA on the cluster that:
> 1. The developer edition of SQL Server does not have the same features as
> the enterprise edition; that the enterprise edition is required for
> implementing the SQL Cluster as this is not featured in the developers
> edition.
> This statement seems to conflict with what Microsoft has posted online at
> ...
> http://www.microsoft.com/sql/prodinfo/features/compare-features.mspx
> "SQL Server 2005 Developer Edition and Evaluation Edition are not listed
> in
> the tables. These editions have the same feature set as the Enterprise
> Edition; the only difference between these editions is the licensing
> policies."
> 2. That reporting services in the developers edition has limitations which
> requires you to upgrade to the standard or enterprise edition in order to
> take advantage of all the bells and whistles for this product. Our DBA
> sats
> the developer edition is just that, a developers editio,n and which is
> normally used for testing before implementing to standard or enterprise
> editions of SQL Server.
> 3. That replicating data from a developers edition to the enterprise
> edition
> of SQL Server Cluster is not supported by Microsoft, thus if issues arise
> Micorsoft will not support this setup.
> So does anyone if there's any truth to our inability to do merge
> replication
> from the Developer Edition to the Cluster?
> Thanks!
>

Can i use Group by in the row filter when i doing merge replication?

Can i use Group by in the row filter when i doing merge replication?
Cheers
nick
no, but depending on what you are trying to do you might be able to
encapsulate it in a UDF.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"Nick" <fsheng@.ebreathe.co.nz> wrote in message
news:udKeCo$BFHA.3708@.TK2MSFTNGP14.phx.gbl...
> Can i use Group by in the row filter when i doing merge replication?
> Cheers
> nick
>
>
>

Friday, February 24, 2012

Can i tell if Procedure is running

Hi, is there a way to know if a procedure is running or not? what i'm trying to accomplish is to automate the merge of tables but only one table at the time can be merge. so i'm thinking that if i have a way of knowing if the merge procedure is running then i could run it only when it's not alreay run it. hope does make sense. thanks.Rather than trying to tell if a particular piece of code is running, which would be shaky at best, create a table in the database - it can be very simple, one column, which is a flag to indicate if the proc is running. When the proc runs have it check the flag, back out if already running, otherwise set the flag, run the merge, and when its done reset the flag.|||Instead of trying to figure if the SP is running or not, use application locks to serialize execution of the SP. Look at sp_getapplock and sp_getreleaselock. You can use it from SQL Server 2000 onwards.

Sunday, February 19, 2012

Can I set a default range for the identity values for merge replication?

Hello,

We have a couple of tables that can have quite a bit of data each day prior to replication. Can we increase the default values for a table for each subscription? For example we have a table called table1 and on the sqlexpress client they could enter in 10000 rows a day, on table2 it's just 100 rows a day. How can we increase the values to where we do not get the error for table1 stating that the insert failed because it conflicted with the identity range check constraint. Thanks in advance.

Hi, John

If I understand correctly, you actually want to set different identityrange from different article. For example, table1 identity range is 10,000 and table2 with identity range is 1,000. You can set it through sp_addmergearticle with control values of @.identityrangemanagementoption, @.pub_identity_range, and @.identity_range.

BTW, you are not allowed to set different identity range for different subscriptions which subscribe to the same publication.

Hope these information will help.

Thanks

Yunjing

Sunday, February 12, 2012

Can I Merge a table with itself ?

Hi,
I have a table which contains several integer columns that represent
similiar date related information. ie
RenewalMonthDay,HomeMonthDay,MotorMonthD
ay etc.
I need a view of the table where these different columns have been merged
into a single column, so where there was one row with x number of integers,
I would have X number of rows with a single integer. Is this possible ?
What I am actually wanting to do is sort the rows based on the value that is
highest / lowest from the values in the row.
Can this be done ?
Thanks,
Jon.Bishman,
select
a.c1,
case b.c1
when 1 then a.c2
when 2 then a.c3
when 3 then a.c4
end as new_c2
from
dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
select 3) as b
go
-- or
select c1, c2 as new_c2
from dbo.t1
union all
select c1, c3
from dbo.t1
union all
select c1, c4
from dbo.t1
go
AMB
"Bishman" wrote:

> Hi,
> I have a table which contains several integer columns that represent
> similiar date related information. ie
> RenewalMonthDay,HomeMonthDay,MotorMonthD
ay etc.
> I need a view of the table where these different columns have been merged
> into a single column, so where there was one row with x number of integers
,
> I would have X number of rows with a single integer. Is this possible ?
> What I am actually wanting to do is sort the rows based on the value that
is
> highest / lowest from the values in the row.
> Can this be done ?
> Thanks,
> Jon.
>
>|||Bishman,
If you are working with 2005, then you can also use new operator "unpivot".
create table dbo.t1 (
a int not null identity unique,
b int,
c int,
d int
)
go
insert into dbo.t1(b, c, d) values(10, 20, 30)
insert into dbo.t1(b, c, d) values(40, 50, 60)
go
select
a, val
from
(
select a, b as c1, c as c2, d as c3
from dbo.t1
) as pvt
unpivot
(val for c in (c1, c2, c3)) as unpvt
go
drop table dbo.t1
go
AMB
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Bishman,
> select
> a.c1,
> case b.c1
> when 1 then a.c2
> when 2 then a.c3
> when 3 then a.c4
> end as new_c2
> from
> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
> select 3) as b
> go
> -- or
> select c1, c2 as new_c2
> from dbo.t1
> union all
> select c1, c3
> from dbo.t1
> union all
> select c1, c4
> from dbo.t1
> go
>
> AMB
> "Bishman" wrote:
>|||Alejandro,
Thanks for these responses.
I like the unpivot one particuarly. I am just seeing if I can get it to work
now !!
I will let you know.
Thanks again,
Jon
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:FD238AE8-02AF-41C1-AD50-8D7DD45B42CD@.microsoft.com...[vbcol=seagreen]
> Bishman,
> If you are working with 2005, then you can also use new operator
> "unpivot".
> create table dbo.t1 (
> a int not null identity unique,
> b int,
> c int,
> d int
> )
> go
> insert into dbo.t1(b, c, d) values(10, 20, 30)
> insert into dbo.t1(b, c, d) values(40, 50, 60)
> go
> select
> a, val
> from
> (
> select a, b as c1, c as c2, d as c3
> from dbo.t1
> ) as pvt
> unpivot
> (val for c in (c1, c2, c3)) as unpvt
> go
> drop table dbo.t1
> go
>
> AMB
>
> "Alejandro Mesa" wrote:
>|||This is working well except I am trying to go past 4 columns ( I need 6)
I get this error when I go to 5 columns....
The type of column "cole" conflicts with the type of other columns specified
in the UNPIVOT list.
with this SQL
USE CastleProspect_Dev
select
ExtractNumber,rowID, RenewalDate
from
(select ExtractNumber,rowID,HomeRenewalMonthDay as a,ContentsRenewalMonthDay
as b,MotorRenewalMonthDay as c, BreakdownRenewalMonthDay as d ,
PetRenewalMonthDay as e from dbo.ExtractDetail) as pvt
unpivot
(RenewalDate for aa in (a, b, c, d, e)) as unpvt
where extractnumber = 99
go
Any Ideas '
Thanks again. This looks like just what I need.
Jon
"Bishman" <jonathan.bishop@.btinternet.com> wrote in message
news:OCrA8rziHHA.4496@.TK2MSFTNGP05.phx.gbl...
> Alejandro,
> Thanks for these responses.
> I like the unpivot one particuarly. I am just seeing if I can get it to
> work now !!
> I will let you know.
> Thanks again,
> Jon
>
>
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in
> message news:FD238AE8-02AF-41C1-AD50-8D7DD45B42CD@.microsoft.com...
>|||Go It !
The two remaining columns have different data type to the other 4, Sorted.
This works really well. Thanks again.
Jon.
"Bishman" <jonathan.bishop@.btinternet.com> wrote in message
news:%23vWauL0iHHA.1388@.TK2MSFTNGP05.phx.gbl...
> This is working well except I am trying to go past 4 columns ( I need 6)
> I get this error when I go to 5 columns....
> The type of column "cole" conflicts with the type of other columns
> specified in the UNPIVOT list.
> with this SQL
> USE CastleProspect_Dev
> select
> ExtractNumber,rowID, RenewalDate
> from
> (select ExtractNumber,rowID,HomeRenewalMonthDay as
> a,ContentsRenewalMonthDay as b,MotorRenewalMonthDay as c,
> BreakdownRenewalMonthDay as d , PetRenewalMonthDay as e from
> dbo.ExtractDetail) as pvt
> unpivot
> (RenewalDate for aa in (a, b, c, d, e)) as unpvt
> where extractnumber = 99
> go
>
> Any Ideas '
> Thanks again. This looks like just what I need.
> Jon
> "Bishman" <jonathan.bishop@.btinternet.com> wrote in message
> news:OCrA8rziHHA.4496@.TK2MSFTNGP05.phx.gbl...
>

Can I Merge a table with itself ?

Hi,
I have a table which contains several integer columns that represent
similiar date related information. ie
RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
I need a view of the table where these different columns have been merged
into a single column, so where there was one row with x number of integers,
I would have X number of rows with a single integer. Is this possible ?
What I am actually wanting to do is sort the rows based on the value that is
highest / lowest from the values in the row.
Can this be done ?
Thanks,
Jon.Bishman,
select
a.c1,
case b.c1
when 1 then a.c2
when 2 then a.c3
when 3 then a.c4
end as new_c2
from
dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
select 3) as b
go
-- or
select c1, c2 as new_c2
from dbo.t1
union all
select c1, c3
from dbo.t1
union all
select c1, c4
from dbo.t1
go
AMB
"Bishman" wrote:
> Hi,
> I have a table which contains several integer columns that represent
> similiar date related information. ie
> RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
> I need a view of the table where these different columns have been merged
> into a single column, so where there was one row with x number of integers,
> I would have X number of rows with a single integer. Is this possible ?
> What I am actually wanting to do is sort the rows based on the value that is
> highest / lowest from the values in the row.
> Can this be done ?
> Thanks,
> Jon.
>
>|||Bishman,
If you are working with 2005, then you can also use new operator "unpivot".
create table dbo.t1 (
a int not null identity unique,
b int,
c int,
d int
)
go
insert into dbo.t1(b, c, d) values(10, 20, 30)
insert into dbo.t1(b, c, d) values(40, 50, 60)
go
select
a, val
from
(
select a, b as c1, c as c2, d as c3
from dbo.t1
) as pvt
unpivot
(val for c in (c1, c2, c3)) as unpvt
go
drop table dbo.t1
go
AMB
"Alejandro Mesa" wrote:
> Bishman,
> select
> a.c1,
> case b.c1
> when 1 then a.c2
> when 2 then a.c3
> when 3 then a.c4
> end as new_c2
> from
> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
> select 3) as b
> go
> -- or
> select c1, c2 as new_c2
> from dbo.t1
> union all
> select c1, c3
> from dbo.t1
> union all
> select c1, c4
> from dbo.t1
> go
>
> AMB
> "Bishman" wrote:
> > Hi,
> >
> > I have a table which contains several integer columns that represent
> > similiar date related information. ie
> > RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
> >
> > I need a view of the table where these different columns have been merged
> > into a single column, so where there was one row with x number of integers,
> > I would have X number of rows with a single integer. Is this possible ?
> >
> > What I am actually wanting to do is sort the rows based on the value that is
> > highest / lowest from the values in the row.
> >
> > Can this be done ?
> >
> > Thanks,
> >
> > Jon.
> >
> >
> >|||Alejandro,
Thanks for these responses.
I like the unpivot one particuarly. I am just seeing if I can get it to work
now !!
I will let you know.
Thanks again,
Jon
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:FD238AE8-02AF-41C1-AD50-8D7DD45B42CD@.microsoft.com...
> Bishman,
> If you are working with 2005, then you can also use new operator
> "unpivot".
> create table dbo.t1 (
> a int not null identity unique,
> b int,
> c int,
> d int
> )
> go
> insert into dbo.t1(b, c, d) values(10, 20, 30)
> insert into dbo.t1(b, c, d) values(40, 50, 60)
> go
> select
> a, val
> from
> (
> select a, b as c1, c as c2, d as c3
> from dbo.t1
> ) as pvt
> unpivot
> (val for c in (c1, c2, c3)) as unpvt
> go
> drop table dbo.t1
> go
>
> AMB
>
> "Alejandro Mesa" wrote:
>> Bishman,
>> select
>> a.c1,
>> case b.c1
>> when 1 then a.c2
>> when 2 then a.c3
>> when 3 then a.c4
>> end as new_c2
>> from
>> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
>> select 3) as b
>> go
>> -- or
>> select c1, c2 as new_c2
>> from dbo.t1
>> union all
>> select c1, c3
>> from dbo.t1
>> union all
>> select c1, c4
>> from dbo.t1
>> go
>>
>> AMB
>> "Bishman" wrote:
>> > Hi,
>> >
>> > I have a table which contains several integer columns that represent
>> > similiar date related information. ie
>> > RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
>> >
>> > I need a view of the table where these different columns have been
>> > merged
>> > into a single column, so where there was one row with x number of
>> > integers,
>> > I would have X number of rows with a single integer. Is this possible ?
>> >
>> > What I am actually wanting to do is sort the rows based on the value
>> > that is
>> > highest / lowest from the values in the row.
>> >
>> > Can this be done ?
>> >
>> > Thanks,
>> >
>> > Jon.
>> >
>> >
>> >|||This is working well except I am trying to go past 4 columns ( I need 6)
I get this error when I go to 5 columns....
The type of column "cole" conflicts with the type of other columns specified
in the UNPIVOT list.
with this SQL
USE CastleProspect_Dev
select
ExtractNumber,rowID, RenewalDate
from
(select ExtractNumber,rowID,HomeRenewalMonthDay as a,ContentsRenewalMonthDay
as b,MotorRenewalMonthDay as c, BreakdownRenewalMonthDay as d ,
PetRenewalMonthDay as e from dbo.ExtractDetail) as pvt
unpivot
(RenewalDate for aa in (a, b, c, d, e)) as unpvt
where extractnumber = 99
go
Any Ideas '
Thanks again. This looks like just what I need.
Jon
"Bishman" <jonathan.bishop@.btinternet.com> wrote in message
news:OCrA8rziHHA.4496@.TK2MSFTNGP05.phx.gbl...
> Alejandro,
> Thanks for these responses.
> I like the unpivot one particuarly. I am just seeing if I can get it to
> work now !!
> I will let you know.
> Thanks again,
> Jon
>
>
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in
> message news:FD238AE8-02AF-41C1-AD50-8D7DD45B42CD@.microsoft.com...
>> Bishman,
>> If you are working with 2005, then you can also use new operator
>> "unpivot".
>> create table dbo.t1 (
>> a int not null identity unique,
>> b int,
>> c int,
>> d int
>> )
>> go
>> insert into dbo.t1(b, c, d) values(10, 20, 30)
>> insert into dbo.t1(b, c, d) values(40, 50, 60)
>> go
>> select
>> a, val
>> from
>> (
>> select a, b as c1, c as c2, d as c3
>> from dbo.t1
>> ) as pvt
>> unpivot
>> (val for c in (c1, c2, c3)) as unpvt
>> go
>> drop table dbo.t1
>> go
>>
>> AMB
>>
>> "Alejandro Mesa" wrote:
>> Bishman,
>> select
>> a.c1,
>> case b.c1
>> when 1 then a.c2
>> when 2 then a.c3
>> when 3 then a.c4
>> end as new_c2
>> from
>> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
>> select 3) as b
>> go
>> -- or
>> select c1, c2 as new_c2
>> from dbo.t1
>> union all
>> select c1, c3
>> from dbo.t1
>> union all
>> select c1, c4
>> from dbo.t1
>> go
>>
>> AMB
>> "Bishman" wrote:
>> > Hi,
>> >
>> > I have a table which contains several integer columns that represent
>> > similiar date related information. ie
>> > RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
>> >
>> > I need a view of the table where these different columns have been
>> > merged
>> > into a single column, so where there was one row with x number of
>> > integers,
>> > I would have X number of rows with a single integer. Is this possible
>> > ?
>> >
>> > What I am actually wanting to do is sort the rows based on the value
>> > that is
>> > highest / lowest from the values in the row.
>> >
>> > Can this be done ?
>> >
>> > Thanks,
>> >
>> > Jon.
>> >
>> >
>> >
>|||Go It !
The two remaining columns have different data type to the other 4, Sorted.
This works really well. Thanks again.
Jon.
"Bishman" <jonathan.bishop@.btinternet.com> wrote in message
news:%23vWauL0iHHA.1388@.TK2MSFTNGP05.phx.gbl...
> This is working well except I am trying to go past 4 columns ( I need 6)
> I get this error when I go to 5 columns....
> The type of column "cole" conflicts with the type of other columns
> specified in the UNPIVOT list.
> with this SQL
> USE CastleProspect_Dev
> select
> ExtractNumber,rowID, RenewalDate
> from
> (select ExtractNumber,rowID,HomeRenewalMonthDay as
> a,ContentsRenewalMonthDay as b,MotorRenewalMonthDay as c,
> BreakdownRenewalMonthDay as d , PetRenewalMonthDay as e from
> dbo.ExtractDetail) as pvt
> unpivot
> (RenewalDate for aa in (a, b, c, d, e)) as unpvt
> where extractnumber = 99
> go
>
> Any Ideas '
> Thanks again. This looks like just what I need.
> Jon
> "Bishman" <jonathan.bishop@.btinternet.com> wrote in message
> news:OCrA8rziHHA.4496@.TK2MSFTNGP05.phx.gbl...
>> Alejandro,
>> Thanks for these responses.
>> I like the unpivot one particuarly. I am just seeing if I can get it to
>> work now !!
>> I will let you know.
>> Thanks again,
>> Jon
>>
>>
>> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in
>> message news:FD238AE8-02AF-41C1-AD50-8D7DD45B42CD@.microsoft.com...
>> Bishman,
>> If you are working with 2005, then you can also use new operator
>> "unpivot".
>> create table dbo.t1 (
>> a int not null identity unique,
>> b int,
>> c int,
>> d int
>> )
>> go
>> insert into dbo.t1(b, c, d) values(10, 20, 30)
>> insert into dbo.t1(b, c, d) values(40, 50, 60)
>> go
>> select
>> a, val
>> from
>> (
>> select a, b as c1, c as c2, d as c3
>> from dbo.t1
>> ) as pvt
>> unpivot
>> (val for c in (c1, c2, c3)) as unpvt
>> go
>> drop table dbo.t1
>> go
>>
>> AMB
>>
>> "Alejandro Mesa" wrote:
>> Bishman,
>> select
>> a.c1,
>> case b.c1
>> when 1 then a.c2
>> when 2 then a.c3
>> when 3 then a.c4
>> end as new_c2
>> from
>> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
>> select 3) as b
>> go
>> -- or
>> select c1, c2 as new_c2
>> from dbo.t1
>> union all
>> select c1, c3
>> from dbo.t1
>> union all
>> select c1, c4
>> from dbo.t1
>> go
>>
>> AMB
>> "Bishman" wrote:
>> > Hi,
>> >
>> > I have a table which contains several integer columns that represent
>> > similiar date related information. ie
>> > RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
>> >
>> > I need a view of the table where these different columns have been
>> > merged
>> > into a single column, so where there was one row with x number of
>> > integers,
>> > I would have X number of rows with a single integer. Is this possible
>> > ?
>> >
>> > What I am actually wanting to do is sort the rows based on the value
>> > that is
>> > highest / lowest from the values in the row.
>> >
>> > Can this be done ?
>> >
>> > Thanks,
>> >
>> > Jon.
>> >
>> >
>> >
>>
>

Can I Merge a table with itself ?

Bishman,
select
a.c1,
case b.c1
when 1 then a.c2
when 2 then a.c3
when 3 then a.c4
end as new_c2
from
dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
select 3) as b
go
-- or
select c1, c2 as new_c2
from dbo.t1
union all
select c1, c3
from dbo.t1
union all
select c1, c4
from dbo.t1
go
AMB
"Bishman" wrote:

> Hi,
> I have a table which contains several integer columns that represent
> similiar date related information. ie
> RenewalMonthDay,HomeMonthDay,MotorMonthDay etc.
> I need a view of the table where these different columns have been merged
> into a single column, so where there was one row with x number of integers,
> I would have X number of rows with a single integer. Is this possible ?
> What I am actually wanting to do is sort the rows based on the value that is
> highest / lowest from the values in the row.
> Can this be done ?
> Thanks,
> Jon.
>
>
Bishman,
If you are working with 2005, then you can also use new operator "unpivot".
create table dbo.t1 (
a int not null identity unique,
b int,
c int,
d int
)
go
insert into dbo.t1(b, c, d) values(10, 20, 30)
insert into dbo.t1(b, c, d) values(40, 50, 60)
go
select
a, val
from
(
select a, b as c1, c as c2, d as c3
from dbo.t1
) as pvt
unpivot
(val for c in (c1, c2, c3)) as unpvt
go
drop table dbo.t1
go
AMB
"Alejandro Mesa" wrote:
[vbcol=seagreen]
> Bishman,
> select
> a.c1,
> case b.c1
> when 1 then a.c2
> when 2 then a.c3
> when 3 then a.c4
> end as new_c2
> from
> dbo.t1 as a cross join (select 1 as c1 union all select 2 union all
> select 3) as b
> go
> -- or
> select c1, c2 as new_c2
> from dbo.t1
> union all
> select c1, c3
> from dbo.t1
> union all
> select c1, c4
> from dbo.t1
> go
>
> AMB
> "Bishman" wrote: