Monday, December 31, 2012

Last Post of The Year 2012

This year in November, while attending a training titled "Making it Happen", when trainer asked everyone to write down their current goals and hurdles that they are facing to achieve those goals, I took lot of time to think about these hurdles and finally filled all five options of hurdles with same words i.e. Me and Myself.

Though year 2012 was amazing, when I have learned a lot about 
  • SQL Server Wait Stats, and how actually to use them to resolve different issues.
  • SQL Serve Extended Events, and how they are going to be a biggest tool in near future for every DBA.
  • SQL Server Service Broker, and its real magics for single point of Administration for multiple instances.
  • SQL Server Log, and interpretation of different type of messages.
  • How to modify System stored procedures according to your need.
  •  And much more
 I think I have shared far less (45 Blog Posts) then I have learned, and I have made a commitment that during 2013 I will keep sharing (through blog post and a book), that What Ever I Will Learn from this community.
For me most inspiring blogger of the year 2012 was Paul Randal and most inspiring personalities were  Jacob Sebastian and Afeef Janjua.

 

Thursday, December 27, 2012

SQL Server: Client IP Along with DDL Change Log Using Service Broker



Last day, we have discussed all three possible methods for DDL Change Log and as per my suggestions, if you don’t need to conditionally allow/disallow changes then Service Broker is the best way to capture these changes. This method additionally allows you to submit change information to a separate instance on internet as a loosely coupled message.

One of blog reader raised a question that what else we need to add in script if we also need to capture machine IP from where change is coming.

Well answer is simple. We already have information of SPID so we can use this SPID and get client machine IP address by querying sys.dm_exec_connections.  
Change already defined stored procedure as following.