Important Note: These are yesterday’s links. Not today’s. That’s why the date is wrong.
SQL SERVER Really Search Cache for Execution Plans Jason Strate revists his code that finds the last plan that was used for a procedure. Reasons for NOT using Varchar(MAX) Pat Wright brings back the argument of why you should or shouldn’t use varchar(max). You can clearly tell from the title how he feels. I’m quoted in this one, so you probably know how I feel.
Jason Massie (twitter) has tagged me in the most recent DBA chain letter. Tim Ford tagged him, and here we are. So, let’s recap, shall we?
So You’re On A Deserted Island With WiFi and you’re still on the clock at work. Okay, so not a very good situational exercise here, but let’s roll with it; we’ll call it a virtual deserted island. Perhaps what I should simply ask is if you had a month without any walk-up work, no projects due, no performance issues that require you to devote time from anything other than a wishlist of items you’ve been wanting to get accomplished at work but keep getting pulled away from I ask this question: what would be the top items that would get your attention?
Changing the location of the default projects folder in Visual Studio is super easy to do. Just click the Tools menu, choose Options, and then select the Projects and Solutions tab to change the default projects folder location:
[caption id=“attachment_643” align=“alignnone” width=“760”] Changing default projects is fun![/caption]
Sadly, this doesn’t change anything for SSMS. Why? I don’t know. However, I do know how to change this in SSMS. Well, google told me.
SQL SERVER GUID Ordering in SQL Server – Look, I know what I’ve said about GUIDs. Nobody wants them around, except developers. The point is that sometimes GUIDs are a necessity. We all might as well learn how to deal with them. Martin Bell does a great job of talking about the various ways of generating GUIDs and the pros and cons of each. Fast ordered delete – Ever want to know how to efficiently perform an ordered delete over a large quantity of data?
Today at work we discovered that DATEADD can do date math involving quarters. Which, if you ask me, is pretty cool. In an effort to avoid work investigate this scenario, we started playing around with our calendar table and DATEADD.``` SELECT [Date], DATEADD(q, -1, [Date]) AS OneQuarterAgo, DATEDIFF(d, [Date], DATEADD(q, -1, [Date])) AS diff_days FROM Calendar WHERE y = 2009
1. We had a different idea of quarter than SQL Server 2.
Big pile o’ link love this week. Honestly, I didn’t include a ton of GREAT links from Brent Ozar because people would start to think that Brent Ozar pays me to link to his site and say Brent Ozar a lot. He doesn’t, but if you click on the links to Brent Ozar maybe he’ll see where the traffic came from and pay me to provide links to Brent Ozar
Typically, moving data isn’t that big of a deal. You can either fire up SSMS and write a quick script to copy data from one server to another. Or, if you need to move data from production into development, you can just do a back up and restore. “Typically” is the key word in the previous paragraph. In my situation, we have a production master that replicates to two separate servers.
Thanks to Ted Krueger (onpnt if you’re on twitter or use lessthandot.com), I now know how to display a BIGINT in RAISERROR. You just used %I64d. It’s documented in BOL as a sidebar note, but you still have to wade through the RAISERROR documentation. So, our code would look like this:``` DECLARE @i AS BIGINT; SET @i = 1;
RAISERROR(’%I64d is a very big number’, 0, 43, @i);
SQL SERVER Find Last Date Time Updated for Any Table Ever want to know when a table was last updated? Now you can find out. Thanks to Pinal Dave for this slick little piece of code, I was totally astounded to know that you could do that. Why use stored procedures? A very well reasoned argument for the use of stored procedures from Paul Nielsen.
DEVELOPMENT More ASP.NET MVC Best Practices Working with ASP.
Let’s say you’re crazy enough to have installed MonoDevelop on OS X. Let’s also postulate that you plan on using NHibernate on OS X to write an ASP.NET MVC app because you are, frankly, far too lazy to boot a virtual machine. Let us further supposed that you want to have sweet sweet XML syntax completion for your NHibernate configuration files. How do you do such a thing? Well, first things first you get a hold of the NHibernate source code.