Sunday, January 31, 2010

SharePoint 2010 Beta 2 SQL Server Version

I ran into some trouble getting SQL Server installed on the same box as SharePoint. It think it may have something to do with the order of installing applications. As a general rule of thumb make sure that you install from the oldest to the newest apps. This is especially true when working with beta software.

Running the configuration wizard I discover that  SharePoint 2010 requires the latest SQL Server updates be installed.

SharePoint2010_Wizard_SQL

SQL Server 2005:

SQL Server 2008:

Posting it here hoping it will save someone else some trouble.

Friday, January 29, 2010

SharePoint Workflow Versioning

Upgrading Workflows in an existing SharePoint site can be very tricky. Just copying in a new version is not the best practice. Depending on what changes were done to the new version of the assembly SharePoint may end up having trouble re-hydrating (deserializing) the currently in-progress workflows.

Here are some excellent articles I found recently on how to properly implement versioning, its potential pitfalls and how to overcome them:

Another alternative approach which I think is also a good solution:

Adding a new item to a SharePoint List

Using SPList.Items.Add() is not the best way to add a new item to a list. This is because the moment you access the get method on the Items collection it retrieves all the items into memory.

A quick peek at the Microsoft.SharePoint.dll assembly via reflector confirmed it:

sharepoint.SPList 

You may not notice a difference in performance in the dev environment, but once your list starts to grow it will gradually degrade.

I recently learned this the hard way. This is the best way to add a new Item:

SPList list = _Web.Lists[LIST];                    SPQuery query = new SPQuery();
query.RowLimit = 0;
SPListItem item = list.GetItems(query).Add();
item[TITLE] = “testing”;
item.Update();

On an unrelated note, executing a query with a RowLimit generates an underlying SQL query such as  SELECT TOP X ..... where X is the RowLimit value.

I wonder if the behavior is still the same in SharePoint 2010. Hmmm...

References:

More best practices on SharePoint: