Posts

Showing posts from February, 2014

The Distributor. Think and Rethink every thing.

Image
The key player in the transactional replication topology is the Distributor. Misconfiguration of the Distributor can lead to increased load on the production server, can interfere with the regular application activities and even cause production databases to become inaccessible. In addition, its configuration greatly impacts the replicated data latency. Changing the Distributor’s configuration after setting up the replication can be problematic and can impact application activity. The main aspects to be considered when planning a replication design are: Number of publications on each publisher in the future replication topology EPS in the replicated tables Number of planned publishers Distance between Publisher, Distributor and Subscribers Number of subscribers for each publication Size of the published Databases Most of the answers to the above questions will lead to the the decision whether you want to have a dedicated Distributor server or configure the Publisher or the

Choosing SEQUENCE instead of IDENTITY? Watch your step.

Image
On the nice sunny day getting this error message can be really frustrating. In fact, it is frustrating on any day. Especially if you are doing something really simple. Most of you at this moment yell at your monitor “DDL Trigger!!!!” . Yes. I have a simple DDL trigger for auditing purposes. If you use the script below for the auditing table, any DDL statement will get pretty red notification to discard the results. CREATE DATABASE  TestDB ; USE  TestDB ; CREATE  SEQUENCE  GetNextNumber  AS  int  START  WITH  1 INCREMENT  BY  1 ; CREATE  TABLE  dbo . TestAuditTable (         ID             int  NOT  NULL  DEFAULT  NEXT  VALUE  FOR  GetNextNumber  PRIMARY  KEY ,         ChangeDate     datetime ,         ObjectName     sysname,        LoginName      sysname ) ; You see, the table is pretty basic, I even use SEQUENCE instead of IDENTITY. Which is, in fact, the main problem. CREATE  TRIGGER  TRG_DDLServer ON    ALL  server For     DDL_EVENTS