Category: SQL Server

  • How to delete DTA Tables

    This script will remove the database tuning advisor tables in the MSDB database on a SQL Server.

  • SQL Server Alerts eMail

    This query will setup email Alerts for severity levels 19 to 25 and errors 823 to 825. It will also create an SQL Agent Operator for you. Reused from http://databasehealth.com/server-overview/quick-scan-report/quick-scan-report-alerts/

  • SQL DBOwner

    If you need to create a DBOwner User and Update all databases to be owned by DBOwner Once you create the DBOwner user this query will create a query to update the database owner to be DBOwner

  • SQL Server Compatibility Level

    Recently I was working on a client’s SQL Server and made some changes to their databases compatibility level frequently I see the level set at 100 which corresponds to SQL Server 2008 and 2008 R2. Anyways I ran into a multiple databases set for Level 100. The SQL Server version was SQL Server 2014 so…

  • Installing SQL from a mounted ISO

    I recently read an article by my good friend Randolph about not using a windows mounted ISO to install SQL server. This got my thinking, I have seen issues before. I’d say 98% of the time it works fine so the problem is rare but I have come across it before. Therefore I also don’t…

  • SQL 2016 Won’t Send Mail

    I’ve come across this problem a few times and always end up googling it so I figured I would make a post for my own benefit and also to help anyone else running into the issue. Basically the RTM version of SQL Server 2016 has a bug in it where it doesn’t reference the correct…

  • SQL DB Execute to a Role

    Have you ever needed a less privileged user to execute Stored Procedures? Me too. Here is how you do it. Run this against the database — Create a db_executor role CREATE ROLE db_executor — Grant execute rights to the new role GRANT EXECUTE TO db_executor Then add the db_executor role to the users you want to be…

  • SQL 2008 and 2008R2 End of Life

    July 9, 2019 is coming faster than we think. That’s the day Microsoft will no longer support SQL 2008 and SQL2008R2. I know there is a thought out there of if its not broken don’t fix it but if your business depends on SQL Server running an unsupported version isn’t a good idea. On top…

  • Max SQL Memory Recommendations

    I can’t take credit for this one. The credit goes to my friend Randolph. His post is at https://bornsql.ca/s/memory/ . He even has a script that will do it for you. This leaves some ram for Windows to use and I’ve found its a good map to follow for production servers. RAM Installed in System…

  • SQL 2012 Standard Memory Limits

    I’ve found there is a lot of confusion around the memory support of SQL 2012 Standard. Traditionally we see 2012 at 64GB and 2014 at 128GB and that is correct. However like most things in technology it depends. Yes SQL 2012 Standard has the 64GB Limit but the Limit only applies to the buffer pool.…

  • DANGER!!! REPAIR_ALLOW_DATA_LOSS

    Danger Do NOT RUN DBCC CheckDB REPAIR_ALLOW_DATA_LOSS DBCC CHECKDB (‘DATABASENAME’, REPAIR_ALLOW_DATA_LOSS); NEVER run the command above on a production database. As it says you will most likely loose data. That syntax commands SQL to throw out any corrupted 8K Page. There can be lots of data in that page and there may be multiple pages…