Checking the Version of SQL Server Before Upgrade

AS I need to upgrade number of servers for SharePoint upgrade I need to confirm about the service packs installed so below is the query to see which service and server is installed

('productlevel'), SERVERPROPERTY ('edition')

The result should be

8.00.2039        SP4        Enterprise Edition

Document Library Upload error After Migration from SPS 2003 to MOSS 2007

During the migration projects that I am currently involved we started to get this very strange error messages.  This error comes when we try to upload the file to a migrated SharePoint Document Library.

Error Messages

The URL ‘FileName’ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web

The details that I have found in the Error logs. 

04/11/2007 19:07:10.88         w3wp.exe (0x1648)         0x1218        Windows SharePoint Services         Database         6f8g        Unexpected        Unexpected query execution failure, error code 8143. Additional error information from SQL Server is included below. "Parameter ‘@ntext5′ was supplied multiple times." Query text (if available): "DECLARE @@S uniqueidentifier; DECLARE @@W uniqueidentifier; DECLARE @@DocId uniqueidentifier; DECLARE @@DoclibRowId int; DECLARE @@Level tinyint; DECLARE @@DocUIVersion int;DECLARE @@IsCurrentVersion bit; DECLARE @@iRet int; DECLARE @DN nvarchar(256); DECLARE @LN nvarchar(128); DECLARE @FU nvarchar(260); SET @DN=N’Program Management/Project Schedules’;SET @LN=N’webtempsps.xml’;SET @FU=N’Program Management/Project Schedules/webtempsps.xml’;SET @@S=’3F243332-4A73-4B14-8511-79AF0BFFA4CA’;SET @@W=’FF553A83-0FA7-4CF1-BBD4-7607232BAA9F’;SET @@DocUIVersion = 512;BEGIN TRAN; IF @@iRet <> 0 GOTO done; SET …        

04/11/2007 19:07:10.88*        w3wp.exe (0x1648)         0x1218        Windows SharePoint Services         Database         6f8g        Unexpected        …@@Level =255; EXEC @@iRet = proc_UpdateDocument @@S, @@W, @DN, @LN, ?, ?,0,413,0,1,268,NULL,NULL,0,0,1,0,928,0,2,1,-2,NULL,1,0,NULL,0,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,@@DocId OUTPUT, @@Level OUTPUT , @@DoclibRowId OUTPUT,? OUTPUT,? OUTPUT,? OUTPUT, ?,?; IF @@iRet <> 0 GOTO done; EXEC proc_DirtyDependents @@S,1,@FU; EXEC @@iRet = proc_UpdateListItem @WebId=’FF553A83-0FA7-4CF1-BBD4-7607232BAA9F’,@SiteId=’3F243332-4A73-4B14-8511-79AF0BFFA4CA’,@ListID=’B2E60891-6D3C-431A-BCF7-48231EFEDD69′,@ItemId=@@DoclibRowId, @NewUIVersion = @@DocUIVersion OUTPUT,@RowOrdinal=0,@ReturnRowset=1,@Size=NULL,@tp_Version=1,@ItemName=N’webtempsps.xml’,@IsDocLib=1,@MajorVersionsLimit=0,@MajorMinorVersionsLimit=0,@UserId=928,@Level=@@Level, @TimeNow=’20070411 14:07:10′,@nvarchar1=?,@nvarchar2=?,@nvarchar3=?,@…        

04/11/2007 19:07:10.88*        w3wp.exe (0x1648)         0x1218        Windows SharePoint Services         Database         6f8g        Unexpected        …nvarchar7=?,@nvarchar8=?,@ntext2=?,@nvarchar9=?,@nvarchar10=?,@nvarchar11=?,@ntext4=?,@ntext5=?, @tp_ContentTypeId = ?,@nvarchar12=?,@ntext5=?,@nvarchar8=?,@nvarchar9=?,@tp_ContentType=?,@tp_ModerationStatus=?,@tp_ItemOrder = 2600.00000000000,@acl=0xF3FE000001000000000000000F00000001000000FFFFFFFFFFFFFF7F08000000FF1BB77EF001004020000000FF1BB77EF001004021000000FF1BB77EF001004022000000FF1BB77EF0010040A5030000FF1BB77CF0010000A6030000EF1BE37CB0010000A7030000FF13433CB0010000A80300002100020000000000AC03000061100308B0000000AD030000EF12033CB0010000AE030000FF1BB77CF0010000AF030000FFFFFFFFFFFFFF7FB0030000FF1BA77CF0010000B103000063100338B0000000; IF @@iRet<> 0 GOTO done; done: IF @@iRet = 0 BEGIN COMMIT; EXEC proc_GetLinkInfoSingleDoc @@S,@DN,@LN, @@Level; END ELSE ROLLBACK; SET ?=@@Level; SET ?=@@i…        

04/11/2007 19:07:10.88*        w3wp.exe (0x1648)         0x1218        Windows SharePoint Services         Database         6f8g        Unexpected        …Ret;"        

04/11/2007 19:07:10.88         w3wp.exe (0x1648)         0x1218        Windows SharePoint Services         General         8kh7        High         The URL ‘Project Schedules/webtempsps.xml’ is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.        

Good news is that we were able to find out the root cause of the problem.  The problem is with SharePoint Solution Generator.  When we generate a list schema using SharePoint Solution Generator in WSS 3.0.  Solution Gen automatically assigns database nvarchar and ntext fields to Columsn in Schema.xml.  In our case the problem was in nvarchar8 and nvarchar9 fields. 

We opened the DB lists table and check the columns XML.  We now get information that the columns that are causing the problems are Status and Projects those are custom columns.  We tryed to figure out the problem but nothing worked but finally after 3 test migration we were able to solve this issue. 


1. Open the SharePoint 2007 List Schema.xml file

2. Go to the Fields Section

3. Remove the ColName="ntext5" or ColName="nVarcharn" where n = number in Fields; for those colums which are added to the list using the UI or any other utility.

In simple words do this step for fields which are not in SharePoint 2003 List Schema.

4. Save the File

5. Install the Feature with -Force.

6. run the migration.

Now go and upload the file again.

I hope this will help.  It may not be a full solutions but will give you some ideas about it.