Home

Contact

Statistics

RSS Feed

I can’t remember where I read it….

a collection of online post-it notes

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 480 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

Setting A Proxy Server For Windows Updates On Vista

I've recently been trying to get automatic Windows updates working on Vista. Every time it tried to fetch the updates, it reported an error code of 80070057. After getting more detailed information from the WindowsUpdate.log in the Windows directory, the problem turned out to be the proxy server in our office. Whilst my user profile has the correct proxy server settings, the Background Intelligent Transfer Service (BITS) that is used to download Windows updates doesn't. The solution is to set the proxy server for the system.

To see the current proxy settings, run from the command line:

netsh winhttp show

If it says "direct", there are no proxy settings and Windows update probably will not work.

To set the proxy settings, run from the command line (you will probably need to run this with administrative permissions):

netsh winhttp set proxy proxy-server= "yourproxy:port"
bypass-list= "<local>"

This will set the proxy server on the system to allow the BITS service to connect to the Windows updates servers.

Add comment Permalink June 25th, 2008 Adrian Banks 93 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

Preventing Accidental Schema Changes To The ‘master’ Database

If you have ever run some SQL within SQL Server Management Studio only to realise that you've run it against the master database by mistake, you'll know that it can sometimes be hard to undo the damage.

A simple way to stop these accidental changes is to create a database trigger that will prevent any schema changes to the master database:

USE master
GO

CREATE TRIGGER StopSchemaChanges ON DATABASE FOR
CREATE_APPLICATION_ROLE, ALTER_APPLICATION_ROLE, DROP_APPLICATION_ROLE,
CREATE_ASSEMBLY, ALTER_ASSEMBLY, DROP_ASSEMBLY,
CREATE_CERTIFICATE, ALTER_CERTIFICATE, DROP_CERTIFICATE,
GRANT_DATABASE, DENY_DATABASE, REVOKE_DATABASE,
CREATE_EVENT_NOTIFICATION, DROP_EVENT_NOTIFICATION,
CREATE_FUNCTION, ALTER_FUNCTION, DROP_FUNCTION,
CREATE_INDEX, ALTER_INDEX, DROP_INDEX,
CREATE_PROCEDURE, ALTER_PROCEDURE, DROP_PROCEDURE,
CREATE_SCHEMA, ALTER_SCHEMA, DROP_SCHEMA,
CREATE_STATISTICS, DROP_STATISTICS, UPDATE_STATISTICS,
CREATE_SYNONYM, DROP_SYNONYM,
CREATE_TABLE, ALTER_TABLE, DROP_TABLE,
CREATE_TRIGGER, ALTER_TRIGGER, DROP_TRIGGER,
CREATE_VIEW, ALTER_VIEW, DROP_VIEW
AS
BEGIN
    RAISERROR ( N 'Do you really modify the master database?' , 16 , 1 ) WITH NOWAIT
    ROLLBACK TRANSACTION
END
GO

Any time you attempt to change the master database, SQL Server will fail with an error. If you do want to make a schema change, simply (External) disable the trigger and then (External) re-enable it once the schema change is complete.

(NB. this only works with SQL Server 2005 )

Add comment Permalink June 8th, 2008 Adrian Banks 152 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

Box Selection In Visual Studio

I was editing a large SQL script inside Visual Studio today and needed to insert several spaces into multiple lines to make the script more readable.

Turning something like this:

some text on line a
some text on line b
some text on line c
some text on line d

into:

some text      on line a
some text      on line b
some text      on line c
some text      on line d

I thought of doing it manually by hand, but as there were lots of lines to alter, I thought there must be a better way. I then remembered a feature of a word processor called (External) ProText that I had many years ago on the Atari ST that had a feature called "Box Selection". This enabled you to select text across multiple lines without having to select the whole line (a bit like drawing a box with the mouse).

A quick search later and I found the (External) instructions on how to do box selections in Visual Studio in an article on (External) Sara Ford 's blog.

Just hold down the Alt key whilst selecting text with the mouse and Visual Studio will switch from its normal "stream selection" mode into "box selection" mode. Once selected, you can indent the text using the tab key as normal and it will insert space to get the desired effect.

Add comment Permalink May 28th, 2008 Adrian Banks 143 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

Blinking Cursor In Firefox

I have recently re-installed Firefox, and was getting more and more annoyed by what seemed to be a blinking cursor appearing in web pages. After a bit of searching, I found out what it was thanks to (External) Rishi who has had the (External) same problem .

It is a feature called "Caret Browsing" which places a cursor in web pages so that text can be selected using only the keyboard. To turn the feature off, just press the F7 key or change the 'accessibility.browsewithcaret' option from the about:config page.

2 comments Permalink March 27th, 2008 Adrian Banks 342 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 Windows .Net Visual Studio Tools SQL Server Opera General Firefox kb C# MSDN Internet Explorer MSBuild Internet Proxy

Links

RSS Feeds Feeds

Visitors

(External)

Visitor Map

Total Hits: 25614
Hits Today: 127


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

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


7th August 2008 19:54:37 GMT

Change Text Only Settings

Graphic version of this page