The Bit Bucket

SQLCMD mode and batch separators

I fell for this one this week. If you execute the following code in SQLCMD mode, what would you expect the output to be?

:SETVAR PrincipalServer WINSTD2K8BASE

:SETVAR MirrorServer WINSTD2K8BASE\SQLDEV02

:SETVAR WitnessServer WINSTD2K8BASE\SQLDEV03

:CONNECT $(PrincipalServer)

SELECT @@SERVERNAME;

:CONNECT $(MirrorServer)

SELECT @@SERVERNAME;

:CONNECT $(WitnessServer)

SELECT @@SERVERNAME;

I’m guessing you might not have expected:

WINSTD2K8BASE\SQLDEV03

WINSTD2K8BASE\SQLDEV03

WINSTD2K8BASE\SQLDEV03

The problem is the lack of a batch separator. What I should have written was this:

2008-08-29

Displaying HTML content in Reporting Services 2008

A friend of mine that works for Microsoft pinged me yesterday about how to strip HTML tags out of text he was trying to display in Reporting Services. He just wanted the text displayed. The typical text looked like this:

SciTech Software is a software development and consulting company. The company was founded in 1991 with the intention of creating software for scientific instruments, but our focus has shifted towards creating tools for developers.

2008-08-25

OT: Political Compass

Rob Sanders pointed me today at the Political Compass. I wondered where I sat in the spectrum. Well this is where. I felt quite a cringe reading some of the questions. I wasn’t surprised that I was more libertarian in my views than authoritarian but I was surprised to see myself slightly more to the left than the right.

2008-08-21

Database mirroring requires transaction log backup regardless

I was setting up mirroring at a client site today and started as I usually do by backing up the primary database and restoring it at the mirror. It would not start mirroring and complained that I didn’t have the latest transaction log backup: the mirror database …., has insufficient transaction log data to preserve the log backup chain of the principal database.

Somewhere along the way, the need to have a transaction log backup has crept in. So, to start mirroring, I just now backup the primary database to a file, backup the transaction log to the same file and then restore both on the mirror server. Then it starts fine.

2008-08-18

Fascinating demo of surface technology

Fellow RD Tim Huckaby’s company has been really pushing the capabilities of the surface platform and building a really interesting set of apps. Most are still embargoed but this one is now allowed to be shown:

(link no longer available)

I suspect many of you will find it really interesting. Enjoy!

2008-08-17

Data Driven Subscriptions in SQL Server 2005 Standard Edition

Recently, I was working at a client’s site where SQL Server 2000 was still in use. They wanted to upgrade to SQL Server 2005. The only reason they were looking at the Enterprise Edition was for data-driven subscriptions in Reporting Services. The CEO certainly wasn’t interested in paying the sort of dollars required for that, just to be able to automatically email out a set of monthly reports to about 30 or so folk within the company.

2008-08-13

Modifying the Thesaurus in Full Text Search in SQL Server 2008

While I was prepping my full-text search session for TechEd Australia today, I decided to modify the thesaurus. I found the discussion in books online a bit confusing regarding the locations of the files involved.

What threw me was it said the default location of the thesaurus files was:

SQL_Server_install_path\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\FTDATA\

I went there and couldn’t find anything. I worked out that for ENU language, my file should be called tsENU.xml. I searched for that and found it in:

2008-08-13

SQL Server 2008 has RTM'd and VS 2008 SP1 Soon

Well it was great news this morning that SQL Server 2008 RTM has hit the download sites. Also keep an eye out for Visual Studio 2008 SP1 which has been listed as coming August 11th.

2008-08-07

Indexing Foreign Keys - should SQL Server do that automatically?

I’ve been doing another performance tuning job today and it highlighted to me once again that problem that a lack of indexes on foreign key columns can bring.

By adding indexes on the foreign keys on three tables, we saw a reduction of 87% in total I/O load on the server. There are other aspects of the system that I’m now working on but it really struck me that having SQL Server do this by default would avoid a lot of apparent performance problems. It would have to be one of the most common indexing issues that I see in my work.

2008-07-28