Author: Jon Gurgul

  • SQL Server Instance Security: Scripting Permissions Part 2

    After writing a powershell way of scripting permissions I thought I better just show the way I used to do it using T-SQL. Although this script is not complete and is kind of relic of my scripting work I thought that I would include it and perhaps maybe if it is on this blog it…

  • SQL Server Instance Security: Scripting Permissions

    Another How-To post and this time focusing on scripting permissions. Here is how to script User(s), Object(s), Role(s), Server Role(s) and Server Object(s) Permissions. Beginning with the simple way via SSMS, before showing a custom script solution that I have written. Scripting SQL Server Security: Simple Solution In order to script the security settings for…

  • Tidy Blog, lazyness and SQLBITS X

    I said I would get round to moving some of the old content, and true to my word albeit several months later I have added the profiler/deadlocks posts. I know I should add new content, rather than repost older bits but I have been rather preoccupied with one thing and another. I can tell you…

  • Capturing Deadlocks

    So, deadlocks. “A deadlock occurs when two or more tasks permanently block each other by each task having a lock on a resource which the other tasks are trying to lock.” http://msdn.microsoft.com/en-us/library/ms178104.aspx How to capture deadlocks? How many ways can you capture a deadlock? Lots! Luckily I do not see a lot of deadlocks in…

  • SQL Server Profiler Trace

    A Trace can easily be used to monitor what is happening within SQL Server, just start SQL Server Profiler via the Tools Menu in SSMS or via a shortcut. Once started it is a relatively easy process: 1. Connect to the SQL Server you wish to run the trace on. 2. Either use the default…

  • Delta and Cumulative IO Stats

    Checking IO statistics has always been one of the most important metrics for any DBA. It is no surprise that most people I know will have some version of the following two scripts that use the dmv sys.dm_io_virtual_file_stats (Transact-SQL). The dmv itself is a cumulative view of your IO, therefore in order to get a particular…

  • SQL Server Memory: Max Server Memory or Task Manager is wrong

    Issue 1: max server memory <> max server memory Okay so you have run sp_configure and checked SQL and it has stolen more memory than you told it to. Aghh! sp_configure ‘show advanced options’, 1; GO RECONFIGURE; GO sp_configure ‘max server memory’, 4096; GO RECONFIGURE; GO http://msdn.microsoft.com/en-us/library/ms178067.aspx Why do you fight me SQL Server? Use…

  • Studying for the SQL MCM 2008 (Microsoft Certified Master)

    This post will list the resources that I have found and that will hopefully give enough material in order to tackle the SQL MCM 2008. It will also provide an update every now and then with my progress. Anyone in the South West  (United Kingdom) preparing for this currently? How easy is it to get a SQL…

  • Motivation & Exams MCDBA MCITP *cough*

    Motivation & Exams I find the hardest thing to obtaining any qualification is time. Unless you are lucky enough to be studying full-time, it is obviously very probable that you like me have a full-time job as well as lots of other responsibilities. Often when asked in the past what I would like to achieve as…

  • List Installed Software aka Get-InstalledSoftware

    I needed a script to check for installed software on local and remote machines that did not rely on the Win32_Product WMI class as this will only return software that the windows installer knows about. One way to do this is via the visual basic script List All Installed Software (Microsoft) on script center, but…