One function which is often requested from my archived blog posts is dbo.FriendlyDateDiff. The Function takes two DateTimes and a requested biggest Dimension like days / hours etc. A sample would be calculating the datediff between My birthdate and the current date: @Startdate = ‘19780619 15:15:00’, @EndDate = ‘20081103 19:33:16’, @BiggestDimension = {PlaceTheDimensionHere} (Should be…


Basta / SQLCon 2008 Slides and samples online

Hi, here are the slides and samples from my presenations at the Basta. I will to a post-session blog in a few days. I noted the questions: Is a join possible in SSDS ? How is an update done in SSDS ? What if I change the schema of a database ? Will Team System…


Merge it your own way — Followup on the test

  After publishing the first test results on a previous post I got in contact with the product team to followup the test results. After redoing the test on real hardware and in a client – server scenario, the following result could be extracted from the tests. As the following charts shows, the Merge statement…


CTP15 of the GDR release of VIsual Studio for Database Professionals is available

For everyone being curious about the product as me, here is the official announcement of the latest public build: Please send your feedback through the Connect platform to make the product even better 🙂 -Jens


Get all system databases of a server

The easiest way for querying all system databases of a server is to assume that databases create by a user come with a database_id >= 5 in sys.databases. But the problem is that distribution databsaes will not be kept into this consideration. Therefore SMO does the following behind the scenes (bioled down to the relevants facts)…


Problems installing Security Update for SQL 2005 SP2 (KB948109)

For the latest security update, there has been some confusion and problems installing it. There is actually an easy way to fix that, as described in the following kb article Error message when you try to install a SQL Server 2005 service pack: “SQL Server Setup failed to modify security permissions on file Drive:\Program Files\Microsoft…


VSTS 2008 Database Edition GDR June CTP

Wow, the new release has just shown up. More information on


VSTS Database Edition having problem creating UnitTests

As some of you might already encountered and found this blog entry while searching the internet, there can be a problem having certain installtion levels of the Data Dude installed on your machines. The error message is: The service Microsoft.VisualStudio.Shell.Interop.ISelectionContainer already exists in the service container Parameter name: serviceType The problem is the PowerTool installation,…


Changing the Login / Authentication Mode programmtically via SMO

Here are some instructions how to change the Login / authentication mode via Code. It just uses plain SMO capabilites:     After this you will have to make sure that the Service is restarted, if you want this to do via SMO look at the following sample. You need to know the ServiceName your…


Obfuscation is not a security feature – Spoofing the APP_NAME

  SQL Server 2005 introduced an interesting and long demanded feature, the LOGON triggers. First only defined via server event triggers, it has become more and more popular in same scenarios to prevent users with a certain machine environment accessing the server. I saw that implemented in forums as denying special users the access during…