Category: SQL Server

  • SQL Index dm_db_index_xxx_stats

    There are 3 dm_db_index_xxx_stats objects that can be used to check and investigate index information. sys.dm_db_index_usage_stats can be used to see how beneficial the index is, and its related maintenance cost. Note that this information is reset upon instance restart. The final two index stats objects provide information on the physical and operational statistics of…

  • Find SQL Server Instances

    Any environment will kick up the odd surprise with extra servers you did not know about (suddenly appearing), which is why I always like to have a look around the environment every so often to see what is there. So how do you find SQL instances and without a 3rd party tool? SQL Command Line…

  • A simple what is running script aka a modern sp_who2

    There is a great deal of information that can be gathered to show what is currently running on SQL Server, but sometimes simple and brief is best. So here is a quick overview gathering scripts with limited bells and whistles. The most important information for user requests is shown which can then be used to…

  • T-SQL: Sequential Numbering

    Introduction It is as easy as 1, 2, 3. A generic numerical sequence which is incremented from a known value. In this article we will look at the options that are available to create sequences which have primarily used identity, and more recently a new tool in the form of SEQUENCE  before finally looking at…

  • Check status of SQL Jobs

    Finding out the status of SQL Jobs is a simple task which can be accomplished via the GUI or in code using EXEC msdb.dbo.sp_help_job. However one issue that is encountered is that the results from this procedure can not easily be used. If an attempt is made to insert the results into another table an…

  • SQL Event for July 2014

    Almost July 2014 and looking forward to what will no doubt be another great SQLBits. This time in Telford. SQLBits XII 17th – 19th July 2014 The International Centre, Telford http://sqlbits.com/ However before SQLBits there is another event that you can still go to if you are quick, and it is in the South West! There are…

  • Checking what permissions they have in SQL Server

    The function sys.fn_my_permissions is very useful for seeing what permissions you have, but it can be just as useful to check someone else. For this all that is needed is to use EXECUTE AS to impersonate them.

  • Dangers of giving dbo in MSDB

    I wanted to talk today about something that I have often seen in environments which is that dbo is granted to msdb without a second thought to the exact implications. So what? Its not got any user data in it, and they need dbo to perform some action not covered by the existing security to do…

  • SQL Saturday 269 Exeter

    Not quite sure where the time is going this year, but coming very shortly is SQL Saturday 269 in Exeter and it is well worth attending. http://www.sqlsaturday.com/269/eventhome.aspx This event will be held on 21st and 22nd March 2014 at Jurys Inn Hotel Exeter, Western Way, Exeter, Devon, EX1 2DB, United Kingdom. (Location details – http://www.sqlsaturday.com/269/location.aspx)

  • SQL Server Login password hash

    In this article we will look at how SQL Server stores passwords and how we can go about working them out. As a developer/administrator you are probably accessing SQL Server via a windows login, however the other option is when the instance is changed into mixed mode allowing SQL Logins. These logins are created within…