AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 15.02.2011, 20:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
emeadaxsupport: Transactional Replication with AX 2009
Источник: http://blogs.msdn.com/b/emeadaxsuppo...h-ax-2009.aspx
==============

Recently I was asked some questions about Transactional Replication with Dynamics AX and SQL Server. For information the following is a list of the supported replication options in AX 2009:

High-availability configuration

Support status

Failover clustering active/passive

Supported

Log shipping

Supported

Transactional replication

Supported

Snapshot replication

Supported

Database mirroring

Supported

Merge replication

Not supported due to complex resolution required to ensure data integrity

Failover clustering active/active

Not supported due to complex resolution required to ensure data integrity

(source: http://technet.microsoft.com/en-us/l.../dd362068.aspx)

The links above take you to the MSDN site with additional information on the SQL replication options.

However, for this blog, I’m concentrating on transactional replication. In order for transactional replication to work you need to have a primary key on each table. By default, AX 2009 does not have a primary key set on each table; therefore you would need to create these before you can configure SQL Transactional replication. In order to make this simple, I’ve created the a class method to do this.

This class goes through all the tables in the AOT. It checks to see if there is a primary key, then if there is not one, it will set the table to have a RecId Index (if not already set). The final step then makes the RecId index the primary key index.

In order to use this, create a new class in the AOT and create a new method. Copy and paste in the code below and then run the class.

PLEASE NOTE: This process updates table definitions in the AOT and the physical table structures on the database server; so please make sure that you have backups of the application folder and database before running this process.



static void CreatePKforTablesWithoutPK(Args _args){ SqlDictionary sqlDict; SysDictTable dictTable; TreeNode node, childNode; str properties; #AOT ; while select tabId from sqlDict group by sqlDict.tabId where sqlDict.fieldId==0 { dictTable = new SysDictTable(sqlDict.tabid); if(dictTable) { //Check to see if the table as a primary key index if(dictTable.primaryIndex()==0) { //No Primary Index node = infolog.findNode(#TablesPath); childNode = node.AOTfindChild(dictTable.name()); if(childNode) { //Set the table to have a RecId index, if it already has property stays as yes. properties = setProperty(childNode.AOTgetProperties(), "CreateRecIdIndex", "Yes"); childNode.AOTsetProperties(properties); childNode.AOTsave(); childNode.AOTrefresh(); //Set the primary index to be the RecId index. properties = setProperty(childNode.AOTgetProperties(), "PrimaryIndex", "RecId"); childNode.AOTsetProperties(properties); childNode.AOTsave(); childNode.AOTrefresh(); Info(dictTable.name() + ' ("' + dictTable.label() + '") has RecId Index added and is set as the PrimaryIndex'); } } } }}


Note: The code is provided as is with no warranties, and confers no rights, and is not supported by Microsoft Support.


author:Thomas Treeneditor:Thomas Treendate:15/Feb/2011


Источник: http://blogs.msdn.com/b/emeadaxsuppo...h-ax-2009.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
semanticax: Dynamics AX 2009 Installation - Application Blog bot DAX Blogs 0 22.12.2010 08:11
emeadaxsupport: Special Permission Settings in Dynamics AX 2009 Blog bot DAX Blogs 0 02.09.2010 22:05
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
Arijit Basu: AX 2009 - Quick Overview Blog bot DAX Blogs 4 19.05.2008 14:47

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 22:16.