So many times I’m writing a query, and I think “I want to put this into that project…”, but because I didn’t add it when I first made the query it’s a pain (and I end up copying the text into a new query). But in SSMS 2008, I’ve just noticed the File menu has a “Move <file> into project” entry down near the bottom. So now I can just choose that and my query magically appears in the project. Terrific! There seems to be so many nice little things in SSMS 2008 – try right-clicking on some data in … Continue reading Another new SSMS 2008 goodie – moving files into a project
One of the things on my list of stuff to check out in the RTM version of SQL Server Management Studio in 2008 is the Spatial Results tab that Isaac Kunen talked about a while back. He called it Eye Candy, and it really is. I started by grabbing a set of data from Virtual Earth expert (and good friend) John O’Brien, containing geometry figures for the world. Geometry for things that are on the world isn’t exactly the best, but it was better than nothing. So then there was the matter of converting it to the Geography type. Geometry … Continue reading Map of the world in the Spatial Results tab (and converting from Geometry to Geography)
I always tell people to do exams during Second Shot season. Reason being – it makes the first one a practice. Don’t bother studying, don’t bother stressing, just go and see how you do. Then you can sit it a second time for real. Feel like giving it a go? Register at http://www.microsoft.com/learning/mcp/offers/secondshot/default.mspx before booking. Looking for more? Well, the SQL 2008 exams won’t be around for a while, but there are a lot of other options out there.
I flew into Sydney recently, around the time the Pope was leaving after World Youth Day. I figured if I saw him, I could go and stand near him and sneeze. (Don’t ask me how I’d make myself sneeze – I hadn’t worked out that part of the plan.) Hopefully, he’d reply in the standard way, and I’d have a great story about getting a blessing from the Pope. But then I thought – hang on, the current bloke is German. He’d probably say “Gesundheit” instead, which doesn’t have the same ring to it. I’d be stood there, complaining at … Continue reading The Pope and sneezing
I did this by accident, but turns out it’s a really useful feature. I was just trying to zoom in on something using Zoomit, that really useful thing that I use whenever I’m presenting these days. But I didn’t have Zoomit running, and so SQL Server Management Studio ran sp_who. And it’s not even new. This is an old Query Analyzer thing – I just hadn’t come across it before. And it’s extensible! Go to Tools, Options, Environment, Keyboard. By default, sp_who is Ctrl+1, sp_lock is Ctrl+2 and sp_help is Alt+F1 (which runs on whatever you have highlighted). Then pick … Continue reading Ctrl+1 in SSMS for sp_who, plus more
Time seems short at the moment. I’m putting the finishing touches on a presentation for TechEd Australia 2008. I’m not on the list of speakers at the moment, but I will be when they’re next updated (there are a few blanks still). I’m giving a talk about T-SQL techniques, which should be a lot of fun. There was a similar talk given in the US this year, but this is very much my own. I’m going to be following a similar format as the US talk, but there’s remarkably little overlap in the two talks. The US talk seemed very … Continue reading Busy times recently
This is a question I seem to answer for people quite often, so I thought I’d write a blog post about it. Suppose you’re joining between two tables (or more, but we’ll only consider two to keep things simple) in the AdventureWorks sample database on SQL Server 2005. SELECT *FROM Production.ProductSubcategory s LEFT JOIN Production.Product p ON p.ProductSubcategoryID = s.ProductSubcategoryID; I’m doing a LEFT JOIN, because in my results, I want to make sure that I have all the subcategories listed. For fun, you might want to insert a subcategory into Production.ProductSubcategory, so that this query returns a NULL Product … Continue reading Filtering results without losing the OUTER JOIN
It was unfortunate news when I heard that the UNICEF Australia site was hacked a little while ago. An old colleague of mine called me to let me know, and to ask if I knew anyone who could help them out. I used to work at a hosting company with this guy, and had seen quite a few websites get hacked one way or another (the typical methods being SQL Injection or Cookie Poisoning). UNICEF is one of my favourite charities. They work to promote and protect the rights of children all over the world. As a kid I remember … Continue reading UNICEF Australia project at TechEd