The Bit Bucket

The need for user-defined index types

Since the removal of the 8KB limit on serialization, the ability to define new data types using SQL CLR integration is now almost at a usable level, apart from one key omission: indexes.

We have no ability to create our own types of index to support our data types. As a good example of this, consider that when Microsoft introduced the geometry and geography (spatial) data types, they did so as system CLR data types but also needed to introduce a spatial index as a new type of index. Those of us that need to work with the product as it’s supplied can’t just create our own new types of index objects.

2011-03-09

Skype, add-on applications, UAC and "Unable to respond"

Just posting this blog tonight hoping it might save someone else a bunch of time. For call recording on Skype, I use a program called Pamela. Lately, when I’d first installed it, it would work fine. Later, however, it would come up and say:

“Another application (Pamela.exe) is attempting to access Skype, but we are unable to respond”.

You just have to love these sorts of messages that don’t give you the slightest clue about what the problem is.

2011-03-03

What types of objects are useful in SQL CLR?

I’ve had a number of people over the years ask about whether or not a particular type of object is a good candidate for SQL CLR integration. The rules that I normally apply are as follows:

Database Object Transact-SQL Managed Code
Scalar UDF Generally poor performance Good option when limited or no data-access
Table-valued UDF Good option if data-related Good option when limited or no data-access
Stored Procedure Good option Good option when external access is required or limited data access
DML Trigger Good option Rarely a good option as most perform substantial data access
DDL Trigger OK option if only limited processing of XML EVENTDATA Good option for extensive processing of XML EVENTDATA
Aggregate Not possible Good option
User-defined Data Type Only alias types Good option

 Scalar UDFs written in Transact-SQL are well-known for causing performance problems in SQL Server environments. Managed code is often a good option (and generally a much faster option) for implementing scalar UDFs as long as the functions do not depend on heavy data access.Table-valued Functions that are data-oriented are likely to be best implemented in Transact-SQL. A common use case for managed code in table-valued UDFs is for functions that need to access external resources such as the file system, environment variables, registry, etc.

2011-02-25

Should vendors have an express queue for people who have a clue? What passes for support today?

It’s good to see some airports that have queues for people that travel frequently and know what they’re doing. But I’m left thinking that IT vendors need to have something similar.

Bigpond (part of Telstra) in Australia have recently introduced new 42MB/sec modems on their 3G network. It’s actually just a pair of 21MB/sec modems linked together but the idea is cute. Around most of the country, they work pretty well. In the middle of the CBD in Melbourne however, at present they just don’t work.

2011-02-22

Slow in the Application but Fast in SQL Server Management Studio - from Erland

Our MVP buddy Erland Sommarskog doesn’t post articles that often but when he does, you should read them. His latest post is here:

http://www.sommarskog.se/query-plan-mysteries.html  

It talks about why a query might be slow when sent from an application but fast when you execute it in SSMS. But it covers way more than that. There is a great deal of good info on how queries are executed and query plans generated.

Highly recommended!

2011-02-22

EULAs, Passwords and the Apple AppStore

One thing about being around the industry since the days when dinosaurs roamed the Earth, is that you can get to be a little philosophical about the industry at times. There are two things that I’ve been thinking about again today, where we seem to be in total denial. One is EULAs; the other is passwords.

Has anyone tested EULAs in court lately? It’s hard to imagine most of them being very enforceable. More importantly, does anyone EVER read them? I was amused a few years back when I was installing an application, clicked over the EULA and the application said “how could you possibly have read that in 1.076 seconds?”. That’s a fair cop.

2011-01-19

In SQLCMD mode, should CONNECT be an implicit batch separator?

Hi Folks,

I’ve been working with SQLCMD mode again today and one thing about it always bites me. If I execute a script like:

:CONNECT SERVER1

SELECT @@VERSION;

:CONNECT SERVER2

SELECT @@VERSION;

:CONNECT SERVER3

SELECT @@VERSION;

I’m sure I’m not the only person that would be surprised to see all three SELECT commands executed against SERVER3 and none executed against SERVER1 or SERVER2. If you think that’s odd behavior, here’s where to vote: https://connect.microsoft.com/SQLServer/feedback/details/611144/sqlcmd-connect-to-a-different-server-should-be-an-implicit-batch-separator#details

2011-01-17

Should SQL Server tools target wide screen formats instead of portrait formats?

There was a short discussion on the SQL Down Under mailing list this morning about screen resolutions for working with the SQL Server tools. In particular, the issue was about how unusable the tools are on the 1366x768 resolution notebooks that now seem to be the most common. While finding a notebook with an appropriate resolution is obviously the answer at this time, I started thinking that the product itself needs to address this.

2011-01-17

Log Shipping Between SQL Server Versions (perhaps 2005 to 2008)

One of the discussion lists that I participate in, had a brief discussion this morning about whether or not it’s possible to perform log shipping between differernt versions of SQL Server. Specifically, can you do log shipping between SQL Server 2005 and SQL Server 2008?

SQL Server does support restoring earlier version databases on later versions of the product. The databases get upgraded along the way when you perform restores of databases. SQL Server also allows you to restore transactions logs from earlier versions of the product but (as Robert Davis points out in the comments below), the upgrade doesn’t happen until recovery of the database occurs. And that’s why you can’t use STANDBY mode in this situation.

2011-01-12

New Upgrade Technical Reference for SQL Server 2008 R2

Hi Folks,

A year or two back, I was involved in a project with my colleagues (led by Ron Talmage) to construct an Upgrade Technical Reference for SQL Server 2008. It seemed to be well received.

We’ve updated it now to SQL Server 2008 R2 and it’s just been published. You’ll find it on this web site: http://www.microsoft.com/sqlserver/en/us/product-info/why-upgrade.aspx  You’ll need to click on the Upgrade Guide link towards the middle of the RHS under the “Why Upgrade” whitepaper.

2011-01-08