SQL Server 2008 R2复制 - 发布创建无效

时间:2014-11-18 09:04:34

标签: sql-server sql-server-2008 database-replication

我正在尝试使用管理工作室设置从SQL Server 2008 R2(作为发布者)到SQL Server 2000的事务复制。但是,我无法超越出版商的创作。我认为它与其中一个表的自动递增ID有关。

  • 我有4个表将被复制(我将创建一个新的DB作为订阅者)。其中一个表具有自动递增ID。
  • 我为ID-column
  • 在'No'上设置了Not For Replication选项
  • 创建发布时,我将“自动管理标识范围”设置为“手动”。

创建成功,但是当我打开复制监视器时,代理会在快照上显示错误:

表'dbo.tbl_With_auto_increment_ID'的脚本失败。

Error messages:
Source: Microsoft.SqlServer.Smo
Target Site: System.Collections.Generic.IEnumerable`1[System.String] ScriptWithList(Microsoft.SqlServer.Management.Smo.DependencyCollection, Microsoft.SqlServer.Management.Smo.SqlSmoObject[])
Message: Script failed for Table 'dbo.PhraseLog'. 
Stack:    at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(SqlSmoObject[] objects)
   at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateLogBasedArticleSchScript(Scripter scripter, BaseArticleWrapper articleWrapper, Table smoTable)
   at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateLogBasedArticleScripts(ArticleScriptingBundle articleScriptingBundle)
   at Microsoft.SqlServer.Replication.Snapshot.TransSmoScriptingManager.GenerateArticleScripts(ArticleScriptingBundle articleScriptingBundle)
   at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.GenerateObjectScripts(ArticleScriptingBundle articleScriptingBundle)
   at Microsoft.SqlServer.Replication.Snapshot.SmoScriptingManager.DoScripting()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.DoScripting()
   at Microsoft.SqlServer.Replication.Snapshot.SqlServerSnapshotProvider.GenerateSnapshot()
   at Microsoft.SqlServer.Replication.SnapshotGenerationAgent.InternalRun()
   at Microsoft.SqlServer.Replication.AgentCore.Run() (Source: Microsoft.SqlServer.Smo, Error number: 0)
Get help: http://help/0
Source: Microsoft.SqlServer.Smo
Target Site: Void CheckSupportedType(Microsoft.SqlServer.Management.Smo.ScriptingOptions)
Message: Column LANG_TEXT in object PhraseLog contains type NVarCharMax, which is not supported in the target server version, SQL Server 2000.
Stack:    at Microsoft.SqlServer.Management.Smo.Column.CheckSupportedType(ScriptingOptions options)
   at Microsoft.SqlServer.Management.Smo.Column.VersionValidate(ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.Column.ScriptDdlCreateImpl(StringBuilder sb, ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.Column.ScriptDdl(StringCollection queries, ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.Table.ScriptTableInternal(ScriptingOptions so, StringBuilder sb, ColumnCollection columns, IndexCollection indexes)
   at Microsoft.SqlServer.Management.Smo.Table.GetTableCreationScript(ScriptingOptions so, StringBuilder sb)
   at Microsoft.SqlServer.Management.Smo.Table.ScriptCreate(StringCollection queries, ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.SqlSmoObject.ScriptCreateInternal(StringCollection query, ScriptingOptions so)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithListWorker(DependencyCollection depList, SqlSmoObject[] objects)
   at Microsoft.SqlServer.Management.Smo.Scripter.ScriptWithList(DependencyCollection depList, SqlSmoObject[] objects) (Source: Microsoft.SqlServer.Smo, Error number: 0)
Get help: http://help/0

我尝试将Not For Replication选项设置为Yes / No,但这似乎不会影响结果,无论是“自动管理标识范围”是手动还是自动。

如果我将“自动管理标识范围”设置为自动,则发布创建失败(在ddding article 4 of 4'上):

===================================

SQL Server Management Studio could not create article 'PhraseLog'. (New Publication Wizard)

===================================

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand)
   at Microsoft.SqlServer.Replication.ReplicationObject.ExecCommand(String commandIn)
   at Microsoft.SqlServer.Replication.Article.CommonArticleCreate()
   at Microsoft.SqlServer.Replication.Article.Create()
   at Microsoft.SqlServer.Management.UI.CreatePublicationWizard.AddArticles(Publication pub, StringBuilder strScriptText, IProgress progress)

===================================

Automatic identity range support is useful only for publications that allow updating subscribers.
Changed database context to 'PhraseLIB'. (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.2550&EvtSrc=MSSQLServer&EvtID=21231&LinkId=20476

------------------------------
Server Name: zwbe-sql-08
Error Number: 21231
Severity: 16
State: 1
Procedure: sp_MSrepl_addarticle
Line Number: 2243


------------------------------
Program Location:

   at Microsoft.SqlServer.Management.Common.ConnectionManager.ExecuteTSql(ExecuteTSqlAction action, Object execObject, DataSet fillDataSet, Boolean catchException)
   at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)

我对复制完全不熟悉,据我所知(在阅读一些网站之后),“自动管理标识范围”和“不用于复制”是唯一需要为自动设置的选项增量表。所以请告诉我这里我做错了什么,

非常感谢你们,

学家

0 个答案:

没有答案