An auditing mind set
I little while back I presented at Pass Data Community Summit. Specifically the presentation was Auditing your data and data access and as with each of the presentations I’ve done I not only learned a...
View ArticleHow do I tell if identity_insert is turned on and if so what table?
TLDR; The code to do this is below but it’s a bit hokey and probably isn’t worth it. It’s pretty unlikely that you’d ever need it. I just had someone ask me this question. It’s an interesting question...
View ArticleSSMS Put pinned tabs in their own row
A while back (6 years ago ) I talked about how you can change the behavior of SSMS so that the pinned tabs have their own row across the top of the screen. In fact, if you have a bunch of pinned tabs...
View ArticleEXECUTE AS USER vs EXECUTE AS LOGIN
I use impersonation a lot. It’s a really easy way to check if someone has the permissions they are supposed to. That said, a co-worker recently had an interesting question. They were testing...
View ArticleUsing DBCC CLONEDATABASE to create a schema only copy of your database.
DBCC CLONEDATABASE is one of those features that I don’t use often but it’s really cool when I need it. I was recently asked to create schema only copies of ~40 databases. This DBCC command was...
View ArticleSQL Server Query Tuning and Optimization by Benjamin Nevarez
I was recently asked to review SQL Server Query Tuning and Optimization by Benjamin Nevarez (blog|twitter), and as soon as I saw who had written the book I jumped at the chance. I want to start this...
View ArticleExplicit and implicit datatype conversions
Did you know that 1/2=0? If you didn’t you could be in for some interesting surprises. 1/2 returns 0 because 1 and 2 are both integers. When you divide two integers you get back an integer. Now, we,...
View ArticleCreating a SERVER ROLE created a LOGIN as well.
One of my co-workers came to me the other day and told me that they found their network id as a login on one of our SQL Server instances. Why is that note worthy? We make a point of using AD groups if...
View ArticleConversion Precedence
Recently I talked about the difference between implicit and explicit datatype conversions. In it I ran this code: DECLARE @IntA INT = 1, @IntB INT = 2; SELECT 1.0*@IntA/@IntB; With the expectation...
View ArticleViewing errors with extended events
A little while back I came across this post: Identifying failed queries with extended events. It has a script to create an extended event that tracks failed queries. I cannot tell you how excited I...
View Article