Category: SQL Server 2012

  • Maintain MSDB email tables

    Credits: SQL Server Central SQL Authority Microsoft Docs Microsoft Docs We recently had an issue where MSDB was growing very quickly, it turned out it was due to a huge increase in data we was directly emailing to users. We now run a weekly job just to maintain the MSDB email tables as whole copies…

    Continue reading

  • Find processes which have been using tempdb

    Credit: Microsoft TechNet On some occasions a few MS SQL databases have exhausted tempdb space, this was due to users leaving computers running for weeks on end and the program using different isolation levels or open transactions. I use the following in SQL in see which process ID have been running the longest, as its…

    Continue reading

  • Add a user to DatabaseMailUserRole on msdb

    I had a user unable to use a script which generated an email, I found the user didn’t have permission, Microsoft state: To reduce the surface area of SQL Server, Database Mail stored procedures are disabled by default. To send Database Mail, you must be a member of the DatabaseMailUserRole database role in the msdb…

    Continue reading