2006/05/24

sp_send_dbmail & blank messages

If you are using sp_send_dbmail stored procedure to send e-mails and the messages you receive are blank, despite the fact that you supplied @body parameter, try switching from TEXT to HTML messages (@body_format parameter).

2006/05/19

How to determine if SQL Server 2005 SP1 is installed

If Service Pack 1 has not installed, the SELECT @@VERSION query returns:

 Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
  Oct 14 2005 00:33:37
  Copyright (c) 1988-2005 Microsoft Corporation
  Standard Edition on Windows NT 5.1 (Build 2600: Dodatek Service Pack 2)

After installing Service Pack 1, it looks like this:

 Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
  Apr 14 2006 01:12:25
  Copyright (c) 1988-2005 Microsoft Corporation
  Standard Edition on Windows NT 5.1 (Build 2600: Dodatek Service Pack 2)

2006/04/27

How to install VMware Tools in VMware Player

After creating a 'new' virtual machine I noticed that I couldn't do a few things that I could do in the other VM (the one that served as a base when creating a 'new' one):
  • I could not move the mouse between the guest system and the host system. Each time I wanted to move from one OS to another, I had to click to grab input and press Crtl+Alt to release it.
  • I could not use the toolbar at the top of the VMware Player without leaving the guest system.
  • I could not use the guest system in fullscreen mode.
  • I could not change the size of the guest system (in a way similar to changing screen resolution) by simply resizing the VMware Player window.
After a short while I realized that the difference between these two virtual machine was the fact that VMware Tools were installed in the old one, but not in the new one.

I installed VMware Tools and it solved all the problems.

This article explains how to install VMware Tools in VWware Player.

2006/04/13

How to create a 'new' virtual machine using only VMware Player

Well, not exactly new, hence the quotation marks.

But if you:
  • already have a virtual machine,
  • need a new one with another operating system, but do not need another configuration for this new machine (for example, smaller or bigger HDD),
you can simply:
  • make a copy of the existing virtual machine's folder,
  • run the machine from the new location,
  • put an installation CD of the new operating system and change the booting device to CD-ROM.
Quick and dirty method, but it works - I installed an evaluation copy of Windows Server 2003 this way.

And if you have more time, you may find these articles interesting:
  VMX-builder
  How-to: VMware player modification
  How to create virtual machines using VMware Player

2006/04/12

Visual Studio - Command Window vs. Immediate Window

While debugging in Visual Studio, I often use Command Window to check values of variables (?mySqlStr), assign values to variables (mySqlStr = "SELECT FOO_ID FROM dbo.FOO") or execute short code snippets (myDS.Fill()).

Today I closed Command Window and re-opened it after a while. And I could no longer evaluate any expressions. I also noticed a > prompt that I've never seen before.

It turns out that Command Window has two different modes (clicky):
  • Command mode - used for executing Visual Studio Commands directly in the IDE, bypassing the menu system, or for executing commands that do not appear in any menu,
  • Immediate mode - used for debugging purposes, evaluating expressions, executing statements, printing variable values, and so forth.
Command mode (notice the prompt)


Switching from Command mode to Immediate mode (type immed and press Enter)

Command Window - Immediate mode (no prompt)

2006/03/30

Finding orphaned packages

If you are using Debian or any other Debian-based Linux distribution, you can use deborphan tool to find orphaned and/or unneeded packages. Read the man page for the options (--guess-all is very useful).

I have just removed over 100 packages. And my system still works. :)

Could it get any less specific?

This is a description of an error that I've read today (here):
This error is not based on any particular query construct. Also, this error is not limited to any particular database environment, to any particular amount of data, or to any particular kind of data. This error may first occur only sporadically. However, this error may occur repeatedly after the first time it occurs.

2006/03/29

How to list all open connections (on Linux)

lsof -i

UPDATE:

sudo lsof -i will show all open connections, not limited to current user.

2006/03/25

How to encode a DVD to an XviD file (on Linux)

There are of course many ways to do it, but a very simple one is to use:
  • Mencoder for ripping and/or encoding,
  • SimpleRip to generate all the necessary commands.

2006/03/15

The OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction

If you use SQL Server 2000 on a machine that is running Windows Server 2003 and fail to start a transaction against a linked server because of the following error:

Server: Msg 7391, Level 16, State 1, Line 2
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction. OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator.

you should check whether Data Transaction Coordinator (MS DTC) can access the network. By default, the network access settings of MS DTC are disabled on computers that are running Windows Server 2003.

Follow these steps to enable the network access settings of MS DTC. In my opinion though, it is not necessary to reboot the computer for these changes to take effect.