SQL Server 2012 auto identity column value jump issue

Submitted by Jochus on Fri, 06/03/2015 - 20:48 | Posted in: Database
Posted in

Problem

From SQL Server 2012 version, when a SQL Server instance is restarted, it can be possible the table's identity value is jumped and the actual jumped value depends on identity column data type. If it is integer (int) data type, then the jump value is 1000 and if big integer (bigint), then jump value is 10000. From our application point of view, this increment is not acceptable for all the business cases specially when the value shows to the client. This is the special case/issue ships with only SQL Server 2012 and older versions have no such issue.

Solutions

  • Using Sequence
    • Remove identity column from tables
    • Create a sequence without cache feature and insert a number from that sequence
    • CREATE SEQUENCE Id_Sequence
          AS INT
          START WITH 1
          INCREMENT BY 1
          MINVALUE 0
          NO MAXVALUE
          NO CACHE
  • Register -t272 to SQL Server startup parameter
    • Open SQL Server configuration manager
    • Select SQL Server 2012 instance
    • Right click => Properties
    • Choose tab: "Startup parameters"
    • Register parameter -t272 in the field: "Specify a startup parameter"
    • Restart the SQL Server 2012 instance

Office 2013 (Word, Excel, Visio ...) distorted display issues

Submitted by Jochus on Fri, 06/03/2015 - 20:38 | Posted in: Windows
Posted in


After a recent Microsoft update, my Office software packages (Word, Excel, Visio, ...) started to do some strange things. Within Office 2013, the screen output would be distorted. The ribbon was not painted properly until I mouse-over them again, or moved Office programs around. Other times the display would look corrupted and the navigation tree would not be properly rendered.

The underlying issue is discussed in KB 2768648 - Performance and display issues in Office 2013 client applications.
While the underlying issue is with the video card driver, there is a workaround until the video driver is updated.

Controlling Via Registry

Set a registry key to disable the feature Disable hardware graphics acceleration:

HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common\Graphics - REG_DWORD - DisableHardwareAcceleration Value: 0x1

Macbook running very slow because of corrupted search index (Spotlight)

Submitted by Jochus on Wed, 29/10/2014 - 22:36 | Posted in: Mac
Posted in


My Macbook was recently running very slow. I've noticed Spotlight was constantly rebuilding the index. By executing the following lines of code in my terminal, the corrupted index was fixed:

$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
$ sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Patching Drupal Views 6.X-2.16 to work with PHP 5.4.X

Submitted by Jochus on Wed, 29/10/2014 - 21:23 | Posted in: Drupal
Posted in


My webhosting recently upgraded to PHP 5.4.X - my website is currently running on an old installation of Drupal 6 (version 33). I was suffering a lot of PHP warnings when browsing through some of my webpages. An interesting patch could be found at https://www.drupal.org/node/1543434, which actually cleared all warnings.

Thanks Peter Bowey!