<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Hilary Cotter</title><subtitle type="html" /><id>http://sqlblog.com/blogs/hilary_cotter/atom.aspx</id><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/default.aspx" /><link rel="self" type="application/atom+xml" href="http://sqlblog.com/blogs/hilary_cotter/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61129.1">Community Server</generator><updated>2007-03-01T16:46:00Z</updated><entry><title>Merge Replication Stored Procedure Conflict Resolver</title><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/archive/2011/11/06/merge-replication-stored-procedure-conflict-resolver.aspx" /><id>http://sqlblog.com/blogs/hilary_cotter/archive/2011/11/06/merge-replication-stored-procedure-conflict-resolver.aspx</id><published>2011-11-06T13:23:00Z</published><updated>2011-11-06T13:23:00Z</updated><content type="html">A conflict in merge replication occurs when applying a replicated command to the subscriber and: there is a constraint violation Foreign Key Violation Primary Key Violation there is an error modifying data Data domain violation Missing dependencies (trigger firing referencing missing objects) Security violation (the account the replication agent runs under does not have rights to apply the replicated command on the publisher/subscriber). You are updating a row which does not exist on the other side...(&lt;a href="http://sqlblog.com/blogs/hilary_cotter/archive/2011/11/06/merge-replication-stored-procedure-conflict-resolver.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=39666" width="1" height="1"&gt;</content><author><name>HCotter</name><uri>http://sqlblog.com/members/HCotter.aspx</uri></author><category term="merge replication" scheme="http://sqlblog.com/blogs/hilary_cotter/archive/tags/merge+replication/default.aspx" /><category term="Replication" scheme="http://sqlblog.com/blogs/hilary_cotter/archive/tags/Replication/default.aspx" /><category term="replication conflicts" scheme="http://sqlblog.com/blogs/hilary_cotter/archive/tags/replication+conflicts/default.aspx" /><category term="stored procedure resolver" scheme="http://sqlblog.com/blogs/hilary_cotter/archive/tags/stored+procedure+resolver/default.aspx" /></entry><entry><title>Implementing Bi-Directional Transactional Replication</title><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/archive/2011/10/28/implementing-bi-directional-transactional-replication.aspx" /><id>http://sqlblog.com/blogs/hilary_cotter/archive/2011/10/28/implementing-bi-directional-transactional-replication.aspx</id><published>2011-10-28T12:12:00Z</published><updated>2011-10-28T12:12:00Z</updated><content type="html">Bi-Directional replication is copying data from one server to another where: • either server can be the source or destination, and • the data being copied can be in the same tables on both sides. For example, I want to replicate a database between Server A and Server B, so that: • the data which originates on Server A will be replicated to Server B, and • the data which originates on Server B will be replicated to Server A. Essentially, I want writeable copies of the data in two different databases...(&lt;a href="http://sqlblog.com/blogs/hilary_cotter/archive/2011/10/28/implementing-bi-directional-transactional-replication.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=39439" width="1" height="1"&gt;</content><author><name>HCotter</name><uri>http://sqlblog.com/members/HCotter.aspx</uri></author></entry><entry><title>SQL Full-text search anomolies</title><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/08/sql-full-text-search-anomolies.aspx" /><id>http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/08/sql-full-text-search-anomolies.aspx</id><published>2007-03-08T13:11:00Z</published><updated>2007-03-08T13:11:00Z</updated><content type="html">&lt;p&gt;On the newsgropes recently I have encountered some posters who are perplexed by the results of their full-text searches.&lt;/p&gt;&lt;p&gt;The first poster was puzzled as to why searches on f.b.i. would not find F.B.I. in his content.&amp;nbsp; SQL FTS and Microsoft Search products index uppercased tokens with periods in them differently than other lower or upper cased tokens. During indexing most language word breakers will index upper cased tokens with periods in them as the token, and then the token with all the periods stripped out. So F.B.I. is indexed as F.B.I. and FBI. All tokens are stored upper cased in the index with the exception of path names (for cosmetic reasons - e.g. in Indexing services a path like c:\TeMp is stored as c:\temp as lowercase was considered to look better than uppercase).&lt;/p&gt;&lt;p&gt;There is no length cut off as far as I am aware. For example, C.R.E.E.P. (Committee to Re-Elect the President - the unfortunately and what we can only hope was unintentional acronym for President Richard Nixon's second election campaign) is indexed as CREEP and C.R.E.E.P. I've tried up to 10 letter combinations.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Here is an example:&lt;/p&gt;Create table testAcronymTable(pk int not null identity constraint testAcronymTablePK primary key, charcol char(20))&lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('F.B.I.')&lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('f.b.i.')&lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('fbi') &lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('FBI')&amp;nbsp; &lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('F B I')&amp;nbsp; &lt;br&gt;&lt;br&gt;insert into&amp;nbsp; testAcronymTable(charcol) values('f b i')&amp;nbsp; &lt;br&gt;&lt;br&gt;GO&lt;br&gt;&lt;br&gt;create fulltext catalog testacronymcatalog&lt;br&gt;&lt;br&gt;GO&lt;br&gt;--indexing using the neutral word breaker&lt;br&gt;create fulltext index on testAcronymTable(charcol language 0) key index testAcronymTablePK on testAcronymCatalog&lt;br&gt;GO&lt;br&gt;--returns f.b.i., F.B.I., F B I and f b i&amp;nbsp; - expected, SQL FTS &lt;br&gt;--throws away the .'s&lt;br&gt;--you get the same results if f, b, and i are removed from the noise list&lt;br&gt;drop fulltext index on testAcronymTable&lt;br&gt;GO&lt;br&gt;--indexing using the American English Word breaker word breaker&lt;br&gt;create fulltext index on testAcronymTable(charcol language 1033) key index testAcronymTablePK on testAcronymCatalog&lt;br&gt;GO&lt;br&gt;select * from&amp;nbsp; testAcronymTable where contains(*,'fbi')&lt;br&gt;GO&lt;br&gt;--returns fbi F.B.I, and FBI - fbi, and FBI are expected, unexpected is&lt;br&gt;--F.B.I, F.B.I is indexed as F.B.I. and FBI.&lt;br&gt;select * from&amp;nbsp; testAcronymTable where contains(*,'FBI')&lt;br&gt;GO&lt;br&gt;--returns fbi F.B.I, and FBI - fbi, and FBI are expected, unexpected is&lt;br&gt;--F.B.I, F.B.I is indexed as F.B.I. and FBI.&lt;br&gt;select * from&amp;nbsp; testAcronymTable where contains(*,'F.B.I.')&lt;br&gt;GO&lt;br&gt;--returns fbi F.B.I, and FBI - F.B.I is expected, unexpected is&lt;br&gt;--FBI and fbi, F.B.I is indexed as F.B.I. and FBI.&lt;br&gt;select * from&amp;nbsp; testAcronymTable where contains(*,'f.b.i.')&lt;br&gt;GO&lt;br&gt;--returns f.b.i., F B I, and f b i -if your noise word list does not contain&lt;br&gt;--f, b, and i&lt;br&gt;--returns nothing -if your noise word list does contain&lt;br&gt;--f, b, and i&lt;br&gt;&lt;br&gt;&lt;p&gt;Note that this works for most languages but does NOT work for the neutral, Chinese (both types),&amp;nbsp; Japanese, and Thai word breakers. They will index F.B.I. as F, B, and I - in other words as three separate letters. Korean will index F.B.I. as F.B.I&lt;br&gt;&lt;/p&gt;&lt;p&gt;The next post covers some of the unusual behaviors while searching on C#, C+, C++, and F#, etc&lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=944" width="1" height="1"&gt;</content><author><name>HCotter</name><uri>http://sqlblog.com/members/HCotter.aspx</uri></author></entry><entry><title>handy replication proc</title><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/01/handy-replication-proc.aspx" /><id>http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/01/handy-replication-proc.aspx</id><published>2007-03-01T15:52:00Z</published><updated>2007-03-01T15:52:00Z</updated><content type="html">&lt;p&gt;A friend of mine called me up last night. He had a problem replicating 300,000,000 transactions per day, or was it per hour. Can't recall, it was a late night.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Anyhowze, with volumes like this replication might not be the best tool. His problem was that the distribution agent to two of his subscribers was hanging on initializing. From experience I know this is caused by depleted buffers on the publisher and the only solution I know of is a reboot. Naturally this was not an option for him.&lt;/p&gt;&lt;p&gt;His has his max distribution retention setting to 72 hours and was under the impression that this would decrease the amount of time required to purse distributed transactions. I told him that min distribution retention setting controlled this, and that his problem with expired subscribers was likely caused by this low max distribution retention setting or the history setting. Subscribers are expired based on the lesser of these two settings.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Anyhowze on with my story - so he asks me what he can do to improve performance and I recommended he use sp_scriptdynamicupdproc to create a more efficient update proc (as his app did heavy updating), or its SQL 2005 analogue sp_scriptsupdproc.&lt;/p&gt;&lt;p&gt;I expect another midnight call from him soon as he continues in his losing battle.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=907" width="1" height="1"&gt;</content><author><name>HCotter</name><uri>http://sqlblog.com/members/HCotter.aspx</uri></author></entry><entry><title>transaction marks</title><link rel="alternate" type="text/html" href="http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/01/transaction-marks.aspx" /><id>http://sqlblog.com/blogs/hilary_cotter/archive/2007/03/01/transaction-marks.aspx</id><published>2007-03-01T15:46:00Z</published><updated>2007-03-01T15:46:00Z</updated><content type="html">&lt;p&gt;There seems to be some confusion out there in the internet about how to implement transaction marks. Or perhaps I was merely very confused about how to implement them. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Transaction marks allow you to restore two or more database to a consistent point in time. For example if you have two database and your app writes to both databases, how do you restore them to a consistent point in time without kicking all your users off the databases? This is complicated by many things, for example backup speed.&lt;/p&gt;&lt;p&gt;I googled looking for a working example but could not find one, so here is a script I wrote to demonstrate it. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;create database MarkedTransaction&lt;br&gt;GO&lt;br&gt;create database MarkedTransaction1&lt;br&gt;GO&lt;br&gt;use MarkedTransaction&lt;br&gt;go&lt;br&gt;create table test1(pk int)&lt;br&gt;GO&lt;br&gt;use MarkedTransaction1&lt;br&gt;GO&lt;br&gt;create table test1(pk int)&lt;br&gt;GO&lt;br&gt;backup database MarkedTransaction to disk='c:\MarkedTransaction.bak' with init&lt;br&gt;GO&lt;br&gt;backup database MarkedTransaction1 to disk='c:\MarkedTransaction1.bak'with init&lt;br&gt;GO&lt;br&gt;begin transaction&lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(1)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(1)&lt;br&gt;commit tran&lt;br&gt;GO&lt;br&gt;begin transaction mark6 with mark 'marked transaction'&lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(2)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(2)&lt;br&gt;commit transaction mark6&lt;br&gt;GO&lt;br&gt;begin transaction mark7 with mark 'marked transaction - 1'&lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(3)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(3)&lt;br&gt;commit tran mark7&lt;br&gt;GO&lt;br&gt;backup log MarkedTransaction to disk='c:\MarkedTransactionlog.bak' with init&lt;br&gt;backup log MarkedTransaction1 to disk='c:\MarkedTransactionlog1.bak' with init&lt;br&gt;GO&lt;br&gt;&lt;br&gt;use master&lt;br&gt;GO&lt;br&gt;--backing up the tail&lt;br&gt;backup log MarkedTransaction to disk='c:\MarkedTransactionlogTail.bak' with init, norecovery&lt;br&gt;backup log MarkedTransaction1 to disk='c:\MarkedTransactionlog1Tail.bak' with init, norecovery&lt;br&gt;GO&lt;br&gt;--restoring the database&lt;br&gt;restore database markedtransaction from disk='c:\markedtransaction.bak' with norecovery &lt;br&gt;restore database markedtransaction1 from disk='c:\markedtransaction1.bak' with norecovery&lt;br&gt;GO&lt;br&gt;--restoring the log &lt;br&gt;RESTORE LOG MarkedTransaction FROM&amp;nbsp; &lt;br&gt;DISK = 'c:\MarkedTransactionlog.bak'&lt;br&gt;WITH&amp;nbsp; STOPATMARK = 'mark6', recovery&lt;br&gt;GO&lt;br&gt;&lt;br&gt;RESTORE LOG MarkedTransaction1 FROM&amp;nbsp; &lt;br&gt;DISK = 'c:\MarkedTransactionlog1.bak' &lt;br&gt;WITH&amp;nbsp; STOPATMARK = 'mark6', recovery &lt;br&gt;GO&lt;br&gt;&lt;br&gt;select * from MarkedTransaction.dbo.test1&lt;br&gt;select * from MarkedTransaction1.dbo.test1&lt;br&gt;--both 1, 2 are there, 3 is not&lt;br&gt;--repeating,&amp;nbsp; but this time we will stop before&lt;br&gt;backup database MarkedTransaction to disk='c:\MarkedTransaction.bak' with init&lt;br&gt;GO&lt;br&gt;backup database MarkedTransaction1 to disk='c:\MarkedTransaction1.bak'with init&lt;br&gt;GO&lt;br&gt;begin transaction&lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(6)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(6)&lt;br&gt;commit transaction&lt;br&gt;GO&lt;br&gt;begin transaction mark8 with mark 'marked transaction -2'&lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(7)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(7)&lt;br&gt;commit transaction mark8&lt;br&gt;GO&lt;br&gt;begin transaction &lt;br&gt;insert into MarkedTransaction.dbo.test1(pk) values(8)&lt;br&gt;insert into MarkedTransaction1.dbo.test1(pk) values(8)&lt;br&gt;commit transaction &lt;br&gt;GO&lt;br&gt;backup log MarkedTransaction to disk='c:\MarkedTransactionlog.bak' with init&lt;br&gt;backup log MarkedTransaction1 to disk='c:\MarkedTransactionlog1.bak' with init&lt;br&gt;GO&lt;br&gt;&lt;br&gt;use master&lt;br&gt;GO&lt;br&gt;backup log MarkedTransaction to disk='c:\MarkedTransactionlogTail.bak' with init, norecovery&lt;br&gt;backup log MarkedTransaction1 to disk='c:\MarkedTransactionlog1Tail.bak' with init, norecovery&lt;br&gt;GO&lt;br&gt;RESTORE Database MarkedTransaction&amp;nbsp; from disk='c:\markedtransaction.bak' with norecovery&lt;br&gt;RESTORE Database MarkedTransaction1&amp;nbsp; from disk='c:\markedtransaction1.bak' with norecovery&lt;br&gt;GO&lt;br&gt;RESTORE LOG MarkedTransaction FROM&amp;nbsp; &lt;br&gt;DISK = N'c:\MarkedTransactionlog.bak' &lt;br&gt;WITH&amp;nbsp; STOPBEFOREMARK = N'mark8' , recovery&lt;br&gt;GO&lt;br&gt;RESTORE LOG MarkedTransaction1 FROM&amp;nbsp; &lt;br&gt;DISK = N'c:\MarkedTransactionlog1.bak' &lt;br&gt;WITH&amp;nbsp; STOPBEFOREMARK = N'mark8' , recovery&lt;br&gt;GO&lt;br&gt;select * from MarkedTransaction.dbo.test1&lt;br&gt;select * from MarkedTransaction1.dbo.test1&lt;br&gt;--both 1, 2, and 6 are there, 7 is not&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=906" width="1" height="1"&gt;</content><author><name>HCotter</name><uri>http://sqlblog.com/members/HCotter.aspx</uri></author></entry></feed>
