Selecting from a list of Values

By Greg 1 comment

Sometimes you have a list of values or parameters that you’d like to run a select statement over the top of to get a result. There’s a few ways of doing this, usually I see people create a Temporary Table and insert the data. But is there an easier way? Yes, we can select from […]

Shadow session in RDP

By Greg No comments

Sometimes I need to shadow a user’s session and the tool we usually use sometimes doesn’t work. In those cases, we can try connecting to the user’s session using Microsoft Remote Desktop. Here are the steps: Run the following command to get the users session which will give an output of all active sessions: Find […]

What’s Next?

By Greg 2 comments

Over the last 15+ years as I’ve learnt more and more about SQL Server, I have come to realise how much I love working with it. The more I dig into it, the more I see a need for companies to understand how to keep their data secure, how to keep it available, and how […]

Recording of Adding Commas to Missing Index Requests in sp_BlitzIndex

By Greg No comments

I did some work on sp_BlitzIndex recently. Check out the clip on YouTube:

Runnable, Running and Suspended

By Greg 4 comments

When you send a query to SQL to be executed, the query is compiled and then run. When you have 1 person querying the database, everything runs fine, but when you ramp that up to multiple users, you start to fight for resources. One of those resources is CPU. To manage CPU time, SQL Server […]

Query Hints

By Greg No comments

SQL Server has a couple of keywords that can be added to a query to give the query optimizer some ideas on how to best compile your SQL statements. Hints like FORCE ORDER, MAXDOP and NOEXPAND can be used as a way to tell the optimizer “Hey, I’ve got this idea, you should try it.” […]

Are Stored Procedure Parameters always cached?

By Greg No comments

Does SQL Server always cache your parameters? Does it always keep track of what you pass in?

Can I Rollback a Truncate?

By Greg No comments

There’s a common belief that you cannot rollback a truncate statement in SQL Server, but is that true? We can find out with a pretty simple test. First, we need a table we can truncate. Obviously you don’t want to go and try this out on your Production tables, so lets create a test one: […]