SQL 2008 R2 Install Issue... SQL 2005 Tools Still Installed?

When installing SQL 2008 R2 November CTP I received the following error:

"The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools."

I checked add/remove, I checked the "Program Files" directory, but could not find a trace of the SQL 2005 Express Tools installed.

After a little research I found this posting: http://sqlblogcasts.com/blogs/sqldbatips/archive/2008/08/14/sql-2008-install-blocked-on-express-tools-but-actually-due-to-sql-prompt.aspx

Jasper mentions that older versions of RedGate SQL Prompt can cause this issue. You can find that by digging through the registry and looking for dependencies. In addition to the issue with SQL Prompt (only version 3 and below) there is an issue with the newer version of RedGate SQL Search. I uninstalled boh and SQL 2008 R2 installed fine.

Last Post for Tonight…. maybe

As I was doing a little development tonight I realized that I was using one of the new features of VS2010 and totally forgot it was new.  Some multi-line editing features make what used to be a pain a now simple process:

Optional & Named Parameters in C# 4.0

I have to say this is one of my favorite features added to this new version.  I don’t know how many times I have gone into method overload madness because C# has never supported optional parameters.  VB.Net always has…why not C#?  Well, now it does!

public void AddUser(string firstName, string lastName, string status = "New User") {
  User = new User(firstName, lastName, status);
}


Now this method could be called in a few ways:



AddUser("Sean", "Jaeger", "Working right now");
AddUser("Sean", "Jaeger");
AddUser(lastName: "Jaeger", firstName: "Sean");


Pretty darn  cool!

SQL 2008 / SQL 2008 R2 Frustration

Since I have now run into this issue 3 times and each time had to look it up to find out to fix it, I decided to post about it.  If you use SSMS 2008/2008 R2 you will find out very quickly that altering a table using the GUI will throw an error.  This is because SQL has added a new “feature” to prevent us from doing this.

In order to turn this “feature” off you will need to go to tools > options.  On this screen uncheck this option:

SQL 2008 Prevent Table Saves

I do not think this is a bad “feature”, but it should be something that admins can set at the server level to prevent it in UAT/Production environments… makes little sense in a development environment.

Tuple Type Added to C# 4.0

With C# 4.0 you can now use the new Tuple type instead of creating your very own… far simpler than using a struct or class to accomplish the same task.

There are two ways to create a Tuple in c# 4.0:

var newTuple = new Tuple<string, string, int>("Sean", "Jaeger", 36);
var newTuple = Tuple.Create<string, string, int>("Sean", "Jaeger", 36);


Type inference can also be used (but doesn’t self document):



var newTuple = new Tuple.Create("Sean", "Jaeger", 36);


You can add up to eight parameters now:



var newTuple = new Tuple<int, int, int, int, int, int, int, int>(1, 2, 3, 4, 5, 6, 7, 8);


One huge thing I see in using a Tuple rather than an anonymous type is the fact that scope can be at any level.  As we all know the scope of an anonymous type is limited to the method boundaries.



Fun stuff!

HtmlEncode() Without The HtmlEncode()

<script runat="server" language="c#">
  protected string BadHtml = "<script language='javascript'>alert('Hello');</script>";
</script>
<%=BadHtml%>


The code above would cause an alert box to pop saying “Hello” because it is not HTML encoded.  Typically what you might do here is use the Server.HtmlEncode() method within a property and use that instead.  But now with C# 4.0 & Visual Studio 2010 you can just write this:



<script runat="server" language="c#">
    protected string BadHtml = "<script language='javascript'>alert('Hello');</script>";
</script>
<%:BadHtml%>


Notice the “:” instead of “=”.  This will automatically do the encode for you.  Saving keystrokes is great!

10 Things That Frustrate Me – Part I

I decided that I need to break away from the geeky stuff and post something else.  Below is a list of things that frustrate me day-to-day.  Some are work related, other things are just the environment that we live in today…

  1. People who claim they know a lot more than they really do
  2. Drivers that drive less than the speed limit when the weather is perfect
  3. Pigeons – do I need to explain?
  4. 90 degree weather in April – Arizona was not the only place this year!
  5. People who come to a garage sale and offer $2 on an item marked $20 that is worth $50
  6. Having to press 2 for English… having to look for the English section on instructions… going to Wal-Mart and seeing everything written in Spanish… driving down I-17 and seeing all the billboards in Spanish… American schools teaching English as a SECOND language!!
  7. Most unions – Especially teachers unions…. one of many things destroying America’s education system
  8. Lotus Notes – only 9 steps to flag an email for follow-up, 4 to remove that flag.  What, search by email subject?  That’s silly…
  9. Taxes – we get taxed on the gas that fills the car that we got taxed on to get to work earning a paycheck that has taxes removed so we can pay for a house that gets taxed and to buy food that gets taxed… chewing gum that was taxed… watching cable TV that is taxed… using water that is taxed… electricity… just to die and have the money that we wish to leave to our children taxed.  I am surprised they have not found a way to tax the balance on revolving credit accounts!
  10. People who are afraid to be told they failed or did not do well or as well as others… I can write a book about this one!  Get over it!  America (and most of the world for that matter) was built on the many who failed and the few who succeeded.  We would not have the great technology and scientific knowledge we have today if it were not for those failures that motivated another to push forward.

SQL Reporting Services – Same Machine

A few days ago while in Greensboro, NC I ran into a few issues setting up SQL reporting services on the same machine that SQL Server 2008 is installed.  Apparently if you install SQL reporting services on the same machine as the SQL server running as a non-default instance  you need to first have the SQL Browser Service running.  You then need to configure reporting services to point to [servername]\[instancename].  Typically I would use [servername],[instanceport]… but that does not work!