Friday, October 09, 2009

Shrinking a SQL Server database

The following command can be used to shrink a SQL Server logfile:

DBCC SHRINKFILE(<file name>, 1)

<file name>should be the name, without the extension, so to shrink the log file to a database called test you would use the command

DBCC SHRINKFILE(test_log, 1)

You can shrink a database with the following command:

DBCC SHRINKDATABASE(<database name>, 1)

To shrink a database called test use the command

DBCC SHRINKDATABASE(test, 1)

Sunday, August 30, 2009

Today, I saved the world!

My nan sent me a card for my birthday the other day; then, last night she sent me a text asking me if I enjoyed my birthday celebrations. I sent her a text this morning saying that I had, indeed, enjoyed my celebrations, and thanked her for my card. A few minutes later she texted me back to thank me for my text.

I briefly considered sending her a message to thank her for thanking me for my message thanking her... Then I thought the universe might implode, so I didn't.

Tuesday, August 25, 2009

Sunday, August 09, 2009

Linux in "more user friendly than windows" shock!

I have long had a problem with USB on my Windows XP computer. I built the computer myself about six years ago, and whilst my USB printer, MP3 player, and Canon camera all worked fine, I could never get a single USB thumb drive to work (I tried about three different ones).

The best information I could find suggested that there was a compatibility problem between my Via chipset and AMD processor that gave USB driver problems.

More recently I bought a Panasonic camera that used a USB disk driver instead of a USB camera driver, so that has never worked properly on my computer. I have had to resort to taking my camera to work, downloading the pictures to my work computer and burning them to CD to take home. Very laborious.

Recently I installed Ubuntu Linux on my computer (Jaunty Jackalope), but had not got round to trying it out; so today I decided to actually try it. After going through the installation finalisation and verification, and updating of components I started Firefox, installed a couple of essential Add-ons (GMarks and Download Statusbar) and did some browsing.

I then thought, "I have never tried attaching a USB device whilst running Linux, lets try one." So I attached my Panasonic camera, just to see what would happen, and lo-and-behold, it just worked. Within seconds it had recognised the device and gave me options on opening the photo viewer, browsing the device or doing nothing. I chose to browse the device a was soon looking at all of my photos.

One thing I could not find was a way of reducing the file size. I have an application on Windows XP called Irfanview which has a brilliant "batch conversion" feature. I can select a whole bunch of photos and say convert from jpg to jpg using 80% compression. I lose no visible detail, but the files are much, much smaller.

To get round this, I did another quick web-search, and a few edits and a reboot later I was able to mount my NTFS file system and copy the files to my Windows partition for editing. Result!

Backhanded Compliment

A Bulgarian woman I was talking to in a pub the other night asked me if I was gay, because she thought I was "too beautiful to be straight".

I couldn't decide whether to be flattered or annoyed. :-)

Wednesday, August 05, 2009

Idiot Postman

I had a letter delivered to the wrong address the other day. The house number was mine, but it was the wrong street. I stuck it to my door with a note saying "Wrong address, please re-deliver" and when I got home it had been posted right back through my letter box.

Is the Post Office hiring people with learning difficulties now?