Quantcast
Channel: microsoft sql server – SQL Studies
Browsing latest articles
Browse All 450 View Live

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 Article


How 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 Article


Image may be NSFW.
Clik here to view.

SSMS 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 Article

Image may be NSFW.
Clik here to view.

EXECUTE 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 Article

Using 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 Article


SQL 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 Article

Image may be NSFW.
Clik here to view.

Explicit 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 Article

Image may be NSFW.
Clik here to view.

Creating 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 Article


Conversion 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 Article


Image may be NSFW.
Clik here to view.

Viewing 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
Browsing latest articles
Browse All 450 View Live