Home

Contact

Statistics

RSS Feed

I can’t remember where I read it….

a collection of online post-it notes

Extracting MSI Files (Revisited)

A few years ago, I posted about how to extract the contents of an MSI file without having to go through the process of installing it. The tool used to do this was called (External) Less MSIèrables . This tool does do the job, but the UI is a bit clunky to use, it has a few bugs, and occasionally fails to extract the contents of a file. On top of this, it looks like this tool is not actively developed (it was last updated in 2005), so I recently started to look for an alternative.

It turns out that Microsoft provide this functionality as part of MSIExec that comes as part of the Windows installer. To extract the contents of any MSI file, simply run the following:

msiexec. exe /a installer. msi /qb TARGETDIR=C:\temp

This will extract the complete contents of the MSI file to the specified directory.

Add comment Permalink October 29th, 2009 Adrian Banks 508 Views

Subscribe to this feed (External)

Bookmark this post on del.icio.us (External)

Digg this post on digg.com (External)

Submit this post to DotNetKicks

Share this post

MSDN Lightweight View

Following on from my last post on the MDSN Low Bandwidth View , (External) Scott Hanselman recently (External) tweeted about the beta version of MDSN Lightweight View.

In a similar way to adding (loband) before the .aspx part of the url, putting (lightweight) before the .aspx part of the url will use the new lightweight view of MSDN, meaning a much neater and streamlined version.

In addition, Scott has previously (External) posted about the other modes of MSDN:


Mode
Description
Example
-
The normal MSDN view.
(External) Example
(loband)
A minimal view, focussed on speed.
(External) Example
(lightweight)
A faster lightweight view, including quick links to switch between languages and .Net framework versions.
(External) Example
(pda)
Aimed at PDAs and phones. Turns off the tree and allows a 100% width.
(External) Example
(robot)
Optimised for search engines.
(External) Example
(printer)
A printable version.
(External) Example
(ide)
Used when viewing inside the IDE. Adds send and give feedback links.
(External) Example



Note that the dev10ide view Scott mentions seems to have been removed, and that the lightweight view is currently in beta, so may be liable to change.

Add comment Permalink July 7th, 2009 Adrian Banks 954 Views

Subscribe to this feed (External)

Bookmark this post on del.icio.us (External)

Digg this post on digg.com (External)

Submit this post to DotNetKicks

Share this post

MSDN Low Bandwidth View

Several months ago, I read a tip about passing an extra parameter on the url to MSDN documentation to put it into "low bandwidth" mode. I remember doing it at the time, but almost immediately forgot the url switch. That was until last week when I read (External) Eric Nelson 's (External) post on how to do it.

The trick is to put (loband) before the .aspx part of the url. For example, the low bandwidth version of

(External) http://msdn.microsoft.com/en-us/library/system.object.aspx

becomes

(External) http://msdn.microsoft.com/en-us/library/system.object(loband).aspx

Once you have accessed it, you can persist it by clicking on the "Persist low bandwidth view" link.

Since Eric wrote his post, it seems that a "Switch on low bandwidth view" link has been added into the normal MSDN pages to enable it to be switched on without hacking around with the url.

(External) Jon Galloway has a (External) post that summarises the benefits of the low bandwidth view. For me, the biggest benefit is the speed of loading, since the page doesn't run lots of JavaScript to sync the contents tree to the currently displayed article.

1 comment Permalink April 8th, 2009 Adrian Banks 958 Views

Subscribe to this feed (External)

Bookmark this post on del.icio.us (External)

Digg this post on digg.com (External)

Submit this post to DotNetKicks

Share this post

SQL Server 2005 SP3 Released

(External) Service pack 3 for SQL Server 2005 was (External) released last week. In it, they have fixed a curious (External) bug that I reported back in January.

The bug occurs when trying to delete rows from a table that have a NULL value for an image column. This works fine normally, but if there is a foreign key referencing the table (to any of its columns), any rows that have had their image column updated to be NULL fail to be deleted. This SQL demonstrates the problem:

-- create two linked tables
CREATE TABLE [ dbo ] . [ TableA ]
(
    [ Identity ] [ int ] NOT NULL IDENTITY ( 1 , 1 ) PRIMARY KEY ,
    [ TableB_Identity ] [ int ] NULL
)

CREATE TABLE [ dbo ] . [ TableB ]
(
    [ Identity ] [ int ] NOT NULL IDENTITY ( 1 , 1 ) PRIMARY KEY ,
    [ DATA ] image NULL
)

ALTER TABLE [ TableA ] ADD CONSTRAINT [ FK_TableA_TableB ]
    FOREIGN KEY ( [ TableB_Identity ] ) REFERENCES [ TableB ] ( [ Identity ] )

-- insert some data
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )

-- this delete works successfully
DELETE FROM [ TableB ] WHERE [ DATA ] IS NULL
SELECT COUNT ( * ) AS Remaining_Count_Should_Be_0 FROM [ TableB ]

-- insert some data
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )
INSERT INTO [ TableB ] ( [ DATA ] ) VALUES ( NULL )

-- update the data to be have a NULL value
UPDATE [ TableB ] SET [ DATA ]= NULL WHERE [ DATA ] IS NULL

-- this delete doesn't work
DELETE FROM [ TableB ] WHERE [ DATA ] IS NULL
SELECT COUNT ( * ) AS Remaining_Count_Should_Be_0 FROM [ TableB ]

-- this delete doesn't work
DELETE FROM [ TableB ] WHERE ISNULL ( [ DATA ] , NULL ) IS NULL
SELECT COUNT ( * ) AS Remaining_Count_Should_Be_0 FROM [ TableB ]

-- this delete does work successfully
DELETE FROM [ TableB ] WHERE EXISTS
    (
        SELECT * FROM [ TableB ] AS TB
        WHERE [ DATA ] IS NULL
        AND TB. [ Identity ]= [ TableB ] . [ Identity ]
    )
SELECT COUNT ( * ) AS Remaining_Count_Should_Be_0 FROM [ TableB ]

Not all of the delete queries work correctly. The output of the script is four result sets with the count of how many rows are in the table at each point. All of them should be 0 (as is the case on SQL Server 2000), but in SQL SERVER 2005 without SP3 they are actually 0, 3, 3 and 0.

The simple delete query:

DELETE FROM [ TableB ] WHERE [ DATA ] IS NULL

does not delete any rows after the values for the Data column have been updated to NULL, even though a similar select query:

SELECT * FROM [ TableB ] WHERE [ DATA ] IS NULL

will return rows.

Notably, if either the foreign key is removed, or the:

UPDATE [ TableB ] SET [ DATA ]= NULL WHERE [ DATA ] IS NULL

query is not performed, the script behaves as expected. Additionally, using text or ntext instead of image does not work as well, but using the new varchar(max), nvarchar(max) or varbinary(max) data types does work.

Apparrently, the distinction between NULL values stored as a result of an insert or an update has precendece in the (External) WRITETEXT command:

If the table does not have in row text, SQL Server saves space by not initializing text columns when explicit or implicit null values are added in text columns with INSERT, and no text pointer can be obtained for such nulls. To initialize text columns to NULL, use the UPDATE statement. If the table has in row text, you do not have to initialize the text column for nulls and you can always get a text pointer.

This points to the " text in row " option having a bearing on this behaviour. Indeed, altering this option after creating the tables:

sp_tableoption N 'TableB' , 'text in row' , 'ON'

results in the script working as expected. Useful as a potential workaround.

The bug is present in all versions of SQL Server 2005, but not in SQL Server 2000 or 2008.

A full list of what's changed in SP3 can be found (External) here , with a full list of the bugs fixed (External) here .

Add comment Permalink December 23rd, 2008 Adrian Banks 1439 Views

Subscribe to this feed (External)

Bookmark this post on del.icio.us (External)

Digg this post on digg.com (External)

Submit this post to DotNetKicks

Share this post

Useful Diagnostic Tools

I recently visited a customer site to diagnose some problems with an application deployed on a server. Because I was effectively "visiting blind" in not knowing what was wrong or even if I would have internet access, I had to pre-empt any potential problems and take whatever tools I would need to diagnose them with me.

The following is a list of the tools I took:

This toolset (along with a few custom-written SQL scripts) provided me with everything I needed to collect all the information I needed to get to the bottom of the problems.

2 comments Permalink July 8th, 2008 Adrian Banks 7042 Views

Subscribe to this feed (External)

Bookmark this post on del.icio.us (External)

Digg this post on digg.com (External)

Submit this post to DotNetKicks

Share this post

Previous Posts


Most Popular Posts



Tags

ASP.Net MSBuild SQL Server 2005 Proxy Visual Studio Tools Internet Explorer Internet MSDN .Net C# General Firefox Opera Windows Tips SQL Server kb

Links

RSS Feeds Feeds

Visitors

(External)

Visitor Map

Total Hits: 79290
Hits Today: 102




I can’t remember where I read it…. ©2006-2010 Adrian Banks
Home

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

10th March 2010 16:52:31 GMT

Change Text Only Settings

Graphic version of this page