The cloud can be expensive. I had this hammered home the other day by a simple mistake. I’m currently working with Microsoft’s Azure platform and using one of the free credit options. I get a free $25 a month for a year and fortunately for me this put a… Read more
Help! I backed up my database yesterday and the backup file was about 200MB but today it’s closer to 400! What happened?
This month my friend Michael J Swart(b/t) would like us to talk about the new 2016 version of SQL Server. The feature I want to talk about has been around for a bit. Not because it’s not part of SQL 2016 but because it’s part of… Read more
I did a post the other day on comparing two tables. It was meant as a general overview but I got a fair number of comments and requests for more specifics. So here we go.
I had one comment that TABLEDIFF uses REBAR functionality. So let’s try an…
Many years ago during an interview I was asked to “Name the top 7 DBCC commands that you use.” I think I was able to name 3. Ever since then I’ve paid particular attention to DBCC commands in preparation of the day when I hear that question again. Well not… Read more
I was reading someone’s question the other day on StackExchange and while the existing comments/questions solved the OP’s (original poster) problem they didn’t really answer the question. I was pretty sure I understood what was going on so I decided to throw my own answer into the ring. In the… Read more
I really do. There is a joke that DBAs say no to everything and there is some truth to that. But if I say No it’s for a reason. A good one. Because I hate disappointing people, and I hate making their work harder. But I promise I have a… Read more
Recently I created my first Azure SQL Database. But now I need to connect to it.
There is a highly useful system view called sys.master_files. If you’ve never encountered it before it returns a list of all files from all databases. It’s been somewhat frustrating to me that there is no similar master_objects, master_tables, master_indexes etc. So what does a dev/dba do? Create them! So… Read more
Starting with Randolph’s definition of a best practice (he got it from Wikipedia and it’s more than good enough)
A best practice is a method or…
Let’s start with a very brief definition of some RAID levels.
- RAID 0 : Stripe your data across multiple disks. Writing a portion of the data to each disk. This improves performance but increases the risk of corruption.
- RAID 1 : Mirror your data across multiple disks. This duplicates…
I’ve been working on tuning a query for the last week and I’ve had to make several changes to the query’s logic. I’m always a little nervous when making those types of changes so I try to do some careful testing before I even suggest the changes to the developers.… Read more
One of the things I like best about joining in on Adam Machanic’s (b/t) TSQL Tuesday blog party is that it can force you to explore things you haven’t tried before. Well that’s exactly what Wendy Pastrick (b/t) wanted us to do.… Read more
It always amazes me how often these three commands get confused. Heck it amazes me how long I confused them.
TL;DR; GRANT and DENY are opposites. GRANT applies a positive permission, DENY a negative permission. DENY will always override GRANT. REVOKE is the opposite of GRANT and DENY. It removes… Read more
You have a database with one or more filegroups, and one or more of those filegroups has multiple files. You’ve decided that you don’t actually need some of those additional files and want to get rid of them. Here are some steps you can follow.
Assume there are 5 files… Read more
Oh Noes! I have a job that requires me to run an SSIS package, cmdshell script, etc. And I need them to have specific file level permissions! What do I do! I know I need to run my job/job step as a specific AD/Windows user but I don’t see how… Read more
I’m a big fan of certifications as a training exercise. However not everyone has the same interests. With the new MCSA (well new 6-8 years ago) we were required to take the data exam (70-461), the admin exam (70-462) AND the BI exam (70-463). I know a number… Read more
Me: I think I’m going create a new playground instance.
Myself: Make sure you use a case sensitive (CS) collation when you install it!
I: You mean a collation that forces us to pay attention to the case of the variable names (for example)? So that something like this returns… Read more
Everyone makes mistakes right? And sometimes you create an object and decide later that you messed up and need to rename it.
EXEC sp_rename 'OldName','NewName'
I love this somewhat obscure mathematical operator. All it does is return the remainder of a division statement but even though it’s pretty basic most people I talk to have never heard of it. The format is
dividend % divisor = remainder
DECLARE @remainder INT DECLARE @dividend INT = 10…