Have you ever seen a constraint with a name like PK__TableNam__EA185FBF8FF1529D? It’s kind of funny looking right? I mean it makes no difference in terms of how things run but it does make it a bit of a pain when you need to code with it. Say dropping the… Read more
EXCEPT and INTERSECT are two uncommon commands. Not that they do anything odd but they aren’t exactly well known in any detail or used very often. I’ve been using them myself a bit recently and thought I would explore.
EXCEPT returns any distinct values from the left query…
It amazes me how much easier certain tasks have gotten in SQL Server. I was watching the Nov 2014 SQL Skills insiders video on OFFSET and FETCH by Jonathan Kehayias (b/t) and remembered fondly an interview I did many, many years ago. As part of the… Read more
I don’t think anyone’s ever been happy to get a support call at 11pm on a Saturday night. However this past Saturday that call did have a few things going for it. First of all I was able to spend the first hour or so of it watching the MidnightDBAs… Read more
Over the years I’ve done a number of posts on various aspects of security. In fact the first thing I ever wrote was security related. A brief explanation and solution for the Double Hop problem on SQL Server Central. Well continuing that theme I had an all to brief, but… Read more
First this type of error is because a subquery returned more than one row when it wasn’t allowed to. In some cases (setting the result to a variable or doing an equality (=) for example) a subquery can only return one row. Because this is a error that specifically mentions… Read more
Every month SQL Judo (Russ Thomas) (b/t) challenges us to do his Monthly DBA Challenge. I’ve decided it would be fun (and good practice) to start doing them and blog about it. Another major benefit is that it will force me to move out of… Read more
The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.
Here’s an excerpt:
The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 160,000 times in 2014. If it were an exhibit at the Louvre Museum, it would take about 7 days for…
I work for a large organization that over the last few years has been doing a LOT of reorgs. And what comes with reorgs? Lots of security requests. I’m always working to find easier ways to deal with them and I’ve gotten pretty good at it over time. One common… Read more
So I’ve written my second article for SQL Shack. This time instead of an overview of auditing options in sql server I do a walkthrough of the SQL Server Audits feature. It’s probably one of the easiest systems to implement that SQL Server has but it does have… Read more
The log file is one of those parts of SQL Server I find fascinating. For instance it is composed of VLFs (virtual log files). These VLFs are a logical way for SQL to break the physical file down into smaller pieces. These pieces are then marked as “in use” or… Read more
‘Twas 4:45 Friday, and all through the office
not a creature was stirring, not even the bosses.
The code was checked in, into Tortoise with care,
in hopes a release date – soon would be there.
The devs were all slumped – in front of computers,
while prospects of bonuses… Read more
This is just something I was curious about. I ran my tests and got an answer and now I thought I would share.
I saw someone ask a few weeks ago if it was faster to drop and re-create an index or do an ALTER INDEX REBUILD. I’m not sure, although I suspect they will take about the same amount of time. And what do I do when I’m not sure how… Read more
Almost four months ago I posted my goals for the next year in my two year anniversary post. I pretty much decided I was going to continue on the same way I’d been going. Actively posting, writing the odd article, and hopefully catching up with my certifications. Well not only… Read more
INSERT INTO SELECT and SELECT INTO may be very similar commands but they have some important differences. Every now and again I see people getting confused by the similarities and missing the differences. So here is a quick check list.
- They look similar (I think this one throws people…
The other day I was answering a question about clustered indexes and it lead indirectly to a twitter conversation on whether a date or int column was better as a clustered index. My contention is that a date column (if it is appropriate and will be useful) is a better… Read more
I really enjoyed writing this post last year and honestly still enjoy reading it myself. And since tomorrow is a holiday for a lot of people (I’m in America so I get to make that assumption) it seemed like a good time to bring it out again.…
Every now and again you see articles and posts about putting sp_ at the beginning of a stored procedure. So what does that do and why should we care? The primary effect is that if you put a stored procedure starting with sp_ in master you can call it directly… Read more
You see dozens of blog posts and articles about how the order of a result set is not guaranteed without an ORDER BY clause and here is my contribution to the subject.
You all know I love examples so without further ado here we go:
Using data from AdventureWorks2014