{"id":29,"date":"2013-10-30T00:00:00","date_gmt":"2013-01-01T00:00:00","guid":{"rendered":"https:\/\/www.sqlhammer.com\/blog\/misleading-merge-replication-error-msg-14052"},"modified":"2026-03-18T21:50:16","modified_gmt":"2026-03-18T21:50:16","slug":"misleading-merge-replication-error-msg-14052","status":"publish","type":"post","link":"https:\/\/sqlhammer.com\/index.php\/2013\/10\/30\/misleading-merge-replication-error-msg-14052\/","title":{"rendered":"Misleading Merge Replication Error &#8211; Msg 14052"},"content":{"rendered":"<p>Recently I blogged about two methods to repair transactional replication.<\/p>\n<ul>\n<li><a href=\"http:\/\/www.sqlhammer.com\/blog\/2013\/06\/06\/transactional-replication-fixed-in-minutes\/\">Transactional Replication \u2013 Fixed in Minutes<\/a><\/li>\n<\/ul>\n<p>Today I was attempting to apply the same concept as method #2 (which is from Edward Polley\u2019s &#8211;\u00a0<a href=\"http:\/\/www.sqlservercentral.com\/articles\/Replication\/98897\/\">Super Fast Transactional Replication Repair<\/a>\u00a0&#8211; article) when I came across an oddity in Microsoft\u2019s error reporting.<\/p>\n<p>I was executing <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms187717.aspx\">sp_addmergesubscription<\/a>, which is not the same stored procedure that Edward was referring to in his article, but I passed in \u2018replication support only\u2019 for the\u00a0@sync_type parameter anyways. I then received this error message:<\/p>\n<p>> Msg 14052, Level 16, State 1, Line 1<br \/>\n><br \/>\n> The @sync_type parameter value must be \u201cautomatic\u201d, \u201cnone\u201d, \u201creplication support only\u201d, \u201cinitialize with backup\u201d, or \u201cinitialize from lsn\u201d.<\/p>\n<p>Obviously, I first checked my spelling. I had spelled everything correctly so I was then off to figure out why I was getting an error which explicitly told me my parameter was correct.<\/p>\n<p>So next I looked into the T-SQL of\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms187717.aspx\">sys.sp_addmergesubscription<\/a>. Here is where I found what I\u2019m calling;\u00a0<em>the sloppiness<\/em>.<\/p>\n<p><code>\/<em><\/p>\n<p><strong> Parameter Check: @sync_type.<\/p>\n<p><\/strong> Set sync_typeid based on the @sync_type specified.<\/p>\n<p><strong><\/p>\n<p><\/strong> sync_typeid sync_type<\/p>\n<p><strong> =========== =========<\/p>\n<p><\/strong> 1 automatic<\/p>\n<p><\/em><em> 2 none<\/p>\n<p><\/em>\/<\/p>\n<p>IF LOWER(@sync_type collate SQL_Latin1_General_CP1_CS_AS) NOT IN ('automatic', 'none')<\/p>\n<p>BEGIN<\/p>\n<p>RAISERROR (14052, 16, -1)<\/p>\n<p>RETURN (1)<\/p>\n<p>END<\/code><\/p>\n<p>If you were to run the RAISERROR line in the above script you will receive the message indicating 5 potential options for the @sync_type parameter but the IF statement clearly only accepts 2.<\/p>\n<p>I\u2019ve found this to be because Microsoft re-used the error message which was intended for\u00a0<a href=\"http:\/\/www.g-productions.nl\/index.php?name=sp_MSrepl_addsubscription\">sys.sp_MSrepl_addsubscription<\/a> (called by\u00a0<a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms181702.aspx\">sys.sp_addsubscription<\/a>) on the merge replication side of the feature rather than creating a new, more clear, error message.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I blogged about two methods to repair transactional replication. Transactional Replication \u2013 Fixed in Minutes Today I was attempting to apply the same concept as method #2 (which is from Edward Polley\u2019s &#8211;\u00a0Super Fast Transactional Replication Repair\u00a0&#8211; article) when I came across an oddity in Microsoft\u2019s error reporting. I was executing sp_addmergesubscription, which is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-29","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/29","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/comments?post=29"}],"version-history":[{"count":1,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions"}],"predecessor-version":[{"id":292,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/posts\/29\/revisions\/292"}],"wp:attachment":[{"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/media?parent=29"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/categories?post=29"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlhammer.com\/index.php\/wp-json\/wp\/v2\/tags?post=29"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}