This is a fairly simple one once you’ve seen it, but then so are lots of things :). Let’s say you have a failed SQL Server job.
Here is our job that will fail:
Then we run it and it fails!
And when we click on the error… Read more
Well I’ve done it. I’ve spoken at an event. I’ll discuss how I felt about it and what I learned along the way a bit later. But in the mean time I promised I would make the PowerPoint for my SQL Server Security Basics session available on my blog and… Read more
I was recently asked how to update views. Specifically the question was about using triggers to update a view.
So updating a simple view is easy enough. Per BOL:
- You can modify the data of an underlying base table through a view, as long as the following…
If you work with a number of different instances and have lots of connections open in Management Studio (SSMS) it can be kind of hard to remember which connection is which. Fortunately all of the information you need is readily available.
Connections in the Object Explorer
Notice that for each… Read more
I’ve you’ve run a query similar to the following:
SELECT * FROM sys.dm_exec_requests CROSS APPLY sys.dm_exec_sql_text(sql_handle);
And gotten an error similar to:
Msg 321, Level 15, State 1, Line 9
“sql_handle” is not a recognized table hints option. If it is intended as a parameter to a table-valued function or… Read more
I spent something like 2 hours today trying to figure out how a particular user had access to one of my databases. It’s one of the strangest things I’ve ever seen while playing with SQL Server security. Here’s how it plays out:
You have a windows group called [Kenneth-Laptop\Dwarf] with… Read more
@@ROWCOUNT is a very useful system variable that returns the number of rows read/affected by the previous statement. It’s frequently used in loops and in error handling.
TL;DR Store @@ROWCOUNT into a variable immediately after the command you are interested in to persist the value for later use.
So why… Read more
Figuring out what components of SQL Server are installed on a particular machine has always been a task that has aggravated me. Telling what services have been installed is pretty easy, discovering if the backwards compatibility components were installed, for example, is a bit more difficult. Well recently I found… Read more
The other day I was asked to tune a stored procedure. Not exactly an uncommon task, but I worked something out in the process. I typically want to start by determining what the slowest part of the SP is. Normally I use sys.dm_exec_query_stats and run a query something like this: Read more
This T-SQL Tuesday we are hosted by one of the DBA’s of the night: Jen McCown (b/t). She want’s us to talk about Strategies for managing an enterprise. Honestly, had I know she was hosting I probably would have seen this one coming since she and… Read more
I’m a regular watcher of the Midnight DBA Webshow and one day they mentioned regular expressions. Not a new term for me, but not something I’d ever looked at much. Well as it happens I had something that I needed to use it on a day or two later and… Read more
The default instance actually has an instance name. It’s MSSQLSERVER. This is probably familiar to a lot of you but hold on because I’m going to go a little bit deeper. When we connect to a default instance we typically just put down the server name right? Is that because… Read more
In one of my first IT jobs (back in the dark ages) we had something called the thirty minute rule. Kind of catchy right? But what did it mean? Simply said, if you have made no progress on a problem for 30 minutes go find some help.
The idea… Read more
The tail of the log
A little while back I was feeling overwhelmed by the number of blog posts ideas that I had so I asked around if anyone wanted one. Surprisingly I only had one taker. Warwick Rudd (b/t), and he wrote this great post… Read more
The other day Richie Rump (b/t) mentioned something called a clipboard manager on twitter. I’ll admit I had to ask what exactly they meant, but once it was described to me I realized it was something I’d wanted off and on for years. Basically it’s… Read more
The other day I was asked to pull a list of errors from the SQL Server log into a table for analysis. It seemed like something that others might find useful so I decided to post what I came up with.
First I had to get the number of error… Read more
Earlier today I was working on a project where I was recording some time stamps. In order to get as much precision as possible I decided to go with a datetime2 datatype. Unfortunately when I recorded the time stamp it didn’t quite work out liked I’d hoped.
DECLARE @StartDate datetime2…
Encryption isn’t a subject I spend a lot of time on. I’ve studied it enough to know most (I hope) of the… Read more
As you may have noticed if you read my blog I learn a lot from trolling various forums. In this particular case I was looking at dba.stackexchange.com and came across this great code pattern. Now the answer comes from Andriy M but in the comments they give credit to… Read more
I decided I’d have some fun today. So for your entertainment here is my first crossword puzzle. (Word and PDF versions at the bottom.)
Filed under: DBA Humor, Microsoft SQL Server, SQLServerPedia Syndication Tagged: Humor