Category: SQL Server
- 
		
		
		Check Block Formatting Size for SQL ServerEver want to quickly check to make sure you formatted that volume correctly for SQL Server with 64K Blocks. Run the following command in Powershell 
- 
		
		
		“Windows NT user or group servername\Administrators not found” in MSSQLRan into this problem last night on a new client computer where COMPUTERNAME\Administrators wouldn’t add but changing it to BUILTIN\Administrators did the trick. 
- 
		
		
		How to delete DTA TablesThis script will remove the database tuning advisor tables in the MSDB database on a SQL Server. 
- 
		
		
		SQL Server Alerts eMailThis 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 DBOwnerIf 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 LevelRecently 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 ISOI 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 MailI’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 RoleHave 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 LifeJuly 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 RecommendationsI 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…