SQL Server 2005 SP2 installation issues

Programming No Comments »

Integration services:

You may receive an error like the following:

MSP Error: 29513 SQL Server Setup Failed to compile the Managed Object Format (MOF) file C:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmproviderxpsp2up.mof

The file may exist as sqlmgmprovider.mof, which is a former version created for a former version of the OS (example: you had Windows 2000 Server installed and then upgraded to Windows Server 2003).

The workaround suggested by Microsoft  did not work for me. So I simply renamed the file sqlmgmprovider.mof to sqlmgmproviderxpsp2up.mof which let me install the SP2 of Integration Services.

Database Engine:

A variety of issues, just look at the discussion with 136 replies regarding MSI installer files issues. For the relatively benign

Error 29528. The setup has encountered an unexpected error while Setting Internal Properties.

this easy fix did it for me: http://support.microsoft.com/kb/925976

Just throw away the quoted keys and they will be re-created by the subsequent installation of the service pack, which will hopefully be successful.

It seems SP 2 was rushed out the door, as this insider post confirms, so it might be good advice to wait for SP 3.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Enabling GPS features of Windows Mobile 5

Computing No Comments »

And here’s another hack to enable the GPS settings applet on Windows Mobile 5. I’m still using the PHM registry editor to edit the registry, but this classic program is not really working well on Windows Mobile 5. There might be better Compact Framework based tools today, such as this one. Anyway, it’s ironic that Microsoft just delivered serial port programmability with the Compact Framework 2.0 (System.IO.Ports namespace), and at the same time provided the serial-port-less GPSID programming interface of the gpsapi.dll, luring developers from the more generic serial GPS interfaces towards easy-to-use vendor lock-in, and dealing Windows Mobile 2003 another blow.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

WPF/E and Silverlight on Windows 2000

Computing No Comments »

Highly interesting hacks to install and run WPF/E and even Silverlight on the best MS OS ever, Windows 2000. Rock on, Win2K!

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Using DetailsView to insert when the DataSet is Empty

Programming No Comments »

Scott Mitchell has what is probably the smoothest solution for the GridView which works for the DetailsView just the same:

  1. Put a DetailsView into the EmptyDataTemplate of the “parent DetailsView”
  2. Bind it to the same datasource as the parent
  3. Set the DefaultMode of  the child to “Insert”

Alternatively, you can put a Button into the EmptyDataTemplate and define the click event handler as follows:

protected void Button1_Click(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Insert);

}

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Split()-like string-to-array function in Transact-SQL

Uncategorized 1 Comment »

Transact-SQL doesn’t have arrays or nifty string functions like the C# System.String.Split () or java’s String.split() returning arrays in one swoop. Then again, SQL knows the SELECT … IN statement like

SELECT * FROM table1 WHERE id in (1,2,3,526) 

so why no looping through comma-delimited strings?

A “Table-valued User-defined Function” returning a table variable is a handy and versatile workaround letting you query and loop through the values with near array-like ease.

The code could look like this:

CREATE FUNCTION [dbo].[StringToTable] ( @inputString nvarchar(max), @separator char (1) ) RETURNS @ResultTable TABLE ( [String] nvarchar(max) ) AS BEGIN DECLARE @stringToInsert nvarchar (max) WHILE LEN(@inputString) > 0 BEGIN SET @StringToInsert = LEFT( @inputString, ISNULL(NULLIF(CHARINDEX(@separator, @inputString) - 1, -1), LEN(@inputString) ) ) SET @InputString = SUBSTRING(@InputString, ISNULL (NULLIF (CHARINDEX(@separator, @InputString), 0), LEN(@InputString)) + 1, LEN(@InputString)) INSERT INTO @ResultTable ( [String] ) VALUES ( @StringToInsert ) END RETURN END

Again, the Transact-SQL string functions seem clumsy and inadequate compared with high-level languages. Short of using CLR functions in the database table-valued functions can put custom string operations at your immediate disposal.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in