April 2005 Blog Posts
Fix: "This Project location not fully trusted by .NET Framework..."

Using the Microsoft .NET Framework 1.1 Configuration administrative tool, you need to add a code group with a path to the network share and give it full trust.

A detailed writeup can be found here:

posted @ Thursday, April 28, 2005 10:50 AM | Feedback (2)
T-SQL Avoid Divide by Zero errors

If you know you are going to have zeros appear in the denominator of formulas in a stored procedure or function, use the nullif function to null them out, e.g. nullif(@MyValue, 0).

posted @ Tuesday, April 26, 2005 10:40 AM | Feedback (2)
ACID2 Test

The test is a complex test with a simple result (a happy smiley opposed to a sad smiley face) if your browser meets all the standards.

posted @ Tuesday, April 26, 2005 10:11 AM | Feedback (2)
Against SOA

This is a good article that highlights one of the problems with the hype around SOA:

The complexity involved in creating a full-blown SOA where everything is a service seems to me to more often than not outweigh whatever the benefits of separation of logic is supposed to be in terms of code reuse (and I'm a heretic on that whole issue should remove business logic from your data layer, but only if it makes sense).

posted @ Monday, April 25, 2005 11:14 AM | Feedback (2)
T-SQL - Triggers and @@Rowcount

A good tip from:

Another thing you should look at from a performance standpoint is to check @@ROWCOUNT right at the beginning of the trigger. If the value is 0, that means no rows were affected by the triggering statement and executing the rest of the trigger code is unnecessary. (You should do this in any trigger.)

posted @ Monday, April 25, 2005 10:14 AM | Feedback (2)
.NET Session Based Singleton Object

This article explains how you could build a singleton object in place of multiple objects to use in Session for ASP.NET apps.  This could be very useful in certain cases described in the article:

posted @ Saturday, April 23, 2005 3:24 PM | Feedback (0)
Microsoft .NET Coding Standards

I view standards as mainly useful suggestions (following the primary rule of: “Use a standard unless it is stupid to do so”), but here's what Microsoft does:

posted @ Friday, April 22, 2005 3:15 PM | Feedback (0)
T-SQL: Coalesce vs. IsNull

A bunch of round-ups on the issue, mainly concerning performance (isnull is faster in most of the tests, but then there's a lot of debate about what is being tested):

posted @ Friday, April 22, 2005 1:14 PM | Feedback (0)
Setting up a FoxPro Linked Server for SQL Server 2000

Step 1: Setup a system DSN.  In this case, we will be using a database file.  I named the DSN VFPDBC, and set it to a dbc file called TestDatabase.dbc which contained a table called TestContainedTable.  Create DSN using the Microsoft VFP Driver for .dbf files (there are different drivers listed in the available dropdown).

Step 2: Create the Linked Server in SQL Server Enterprise Manager using the Microsoft OLE DB Provider for ODBC Drivers.  In this case, I named the Linked Server VFPDBC.

Step 3: the syntax in query analyzer to access the table in this case was : VFPDBC.TestDatabase..TestContainedTable

That's it.

posted @ Tuesday, April 19, 2005 1:27 PM | Feedback (1)
Developing Web Parts for SharePoint Portal Server 2003 in .NET

This is a good general overview of what you need to develop Web Parts in .NET

posted @ Monday, April 18, 2005 1:37 PM | Feedback (0)
Different ways of creating audit trails in SQL Server

posted @ Wednesday, April 13, 2005 3:26 PM | Feedback (2)
T-SQL: "exceeds the maximum number of bytes per row (8060)"

“exceeds the maximum number of bytes per row (8060). INSERT or UPDATE of a row in this table will fail if the resulting row length exceeds 8060 bytes.”

This message occurs when the sum of the bytes of the data types of all the columns in a table exceeds the limit that SQL Server allows.  The only real solution for this is to break up the table into multiple tables.

posted @ Wednesday, April 13, 2005 12:28 PM | Feedback (2)
Visio 2002 EA - 'Phantom' Relationship Fix

If you get this error message when doing a model check:

“This relationship is not shown because the entities it is connected to are not placed on the diagram.“

From :

The solution:
- Right click on the table with the problem
- Select "Show related tables", you will get the "phantom" back

posted @ Wednesday, April 13, 2005 12:22 PM | Feedback (1)
.NET - DataTable.Select performance

This method allows you to set filter and sorting criteria and pull all rows that meet them from a DataTable.  However, if you have a large number of rows, the performance nose-dives dramatically.

For instance, with a data table of about 400,000 rows, to do a certain number of iterations of a method that used DataTable.Select took approximately 20 minutes.  By ordering the data and doing some checks on each row within a for loop to make sure it met the criteria I needed, the same number of iterations took less than 1 second.

So, be careful when using DataTable.Select (and make sure you index it, etc. regardless).  If you have a large number of rows, you might find that writing more code (which, depending on your view of for loops, may look messy) performs significantly better.

posted @ Wednesday, April 13, 2005 11:09 AM | Feedback (1)
Indexing Strategies


  1. Does the table contain a column uniquely identifying the row?
    This is a primary candidate for a clustered index.
  2. Will the data be undergoing large numbers of modifications compared to reads? (a ratio of 1:2 or higher)
    Be careful of performance, add few indexes.
  3. Will the table become very large? (>100.000 rows)
    Be careful of the indexes disk usage. Index all fields used in where or sort clauses.
  4. Do most queries sort on a particular field?
    Index this field! Sort the index the way your sorts expect the data.
  5. Do most queries filter on a particular field?
    Index this field! If the query selects a few columns, create a composite index and add the selected fields to the index.
  6. Does the table contain mainly natural language text?
    Consider a full-text index.
posted @ Tuesday, April 12, 2005 2:55 PM | Feedback (2)
Indexed Views

Though old, a good primer on how Indexed Views work in SQL Server 2000:

posted @ Tuesday, April 12, 2005 11:59 AM | Feedback (2)
Indexing Updates and Deletes

This is a good and comprehensive discussion of how to handle indexes as they related to update and delete operations for SQL Server:

posted @ Tuesday, April 12, 2005 9:45 AM | Feedback (2)
HTTP Error 401.2 - Unauthorized: Access is denied due to server configuration

“You do not have permission to view this directory or page using the credentials that you supplied because your Web browser is sending a WWW-Authenticate header field that the Web server is not configured to accept.”

This error will occur if you are trying to use NTLM authorization on a web site, and the users are hitting it from behind a proxy server.  There is no 'fix' for this.  The web site will need to be reconfigured to use basic or digest authentication.

posted @ Monday, April 11, 2005 2:20 PM | Feedback (1)
SCRUM Methodology

This is related to XP.  As with XP, I don't know all of the details, so I can't really judge this (though I am initially skeptical), but there's a lot of info here.

posted @ Monday, April 11, 2005 10:31 AM | Feedback (2)
Arithmetic overflow error converting numeric to data type numeric

When you need to supress error messages like this, you need to set BOTH of the following:

set arithabort off

set ansi_warnings off

Otherwise, if ansi_warnings is on, it will still report errors and terminate batches, regardless of the setting of arithabort.  Also, arithabort overrides arithignore.

posted @ Monday, April 04, 2005 1:37 PM | Feedback (1)
Fallacy of the Data Layer

There's a lot in here for those that deal with SOA to think about.

posted @ Friday, April 01, 2005 11:55 AM | Feedback (2)