SQL Server

Excel Connection Manager and Excel Source in Windows x64

There is no Microsoft.Jet.OLEDB.4.0 provider for 64 bit Windows editions. If you need to use an Excel Source task or Excel Connection Manager in Integration Services on a 64 bit machine (I’m using Vista Ultimate x64), you will need to set your packages, or your project, not to use the 64 bit runtime. This is done by setting the Run64BitRuntime property to false on the project properties’ Debugging tab.

This article on MSDN provides more information about Integration Services running 64 bit editions of SQL Server and Windows.

Also note that if your source file is Excle 2007, the Excel Connection Manager cannot be used and the OLE DB Connection Manager must be used instead. See the note in the linked MSDN article about the Excel Connection Manager.

Technorati tags:

SQL Server

SSIS Lookup Transformation for SQL Server datetime type and DT_DATE

How do you perform a Lookup transformation using an input column of type DT_DATE (e.g. from a spreadsheet input) and a SQL Server table column that has the datetime type? Dragging the former onto the latter results in the error message "One or more columns do not have supported data types, or their data types do not match".

The answer is to create a Data Conversion transformation earlier in the flow. In this task, convert your input column to the type "database timestamp [DT_DBTIMESTAMP]". Make a note of the output alias you have entered. Now go back to the Lookup transformation and drag the new column (i.e. <output alias> of the Data Conversion transformation) onto the datetime column in the lookup table.


SQL Server

Bugs/Omissions in Visual Studio Team Edition for Database Professionals


I’m using Visual Studio Team Edition for Database Professionals and have spotted a couple of niggles with it.

1) If you rename a foreign key field, the schema compare fails to recognize that it needs to update the foreign key constraint. Instead it creates a new one and leaves the old one in place and unchanged, causing an error.

2) Extended properties are behaving strangely. It seems to be dumping them all into a file called “ScriptsIgnoredOnImport.sql”, appending it on to any entry it left in that file last time it ran. As far as I can tell you need to manually copy the extended property creation lines out of this file and into the individual table SQL scripts in the project. Irritating.


SQL Server

Calculated Measures DisplayFolder

In Business Intelligence Studio (AKA Visual Studio 2005), when editing a cube, there is a tab for creating calculations. This tab contains a handy ‘script organizer’ pane showing a list of the names of all your calculations, names sets, etc. Unfortunately if you select an item within the script organizer, the standard properties window does not show "Display Folder" and "Related Measure Group" properties. To get to these properties, there is a "calculation properties" icon near the top of the calculations tab.


SQL Server


A technical post for a change. We recently noticed a difference in SQL Server 2005 over 2000 around the use of the SCOPE_IDENTITY function. I’ve been used to "SELECT SCOPE_IDENTITY()" returning INT as its data type, as that was the largest data type that was allowed as an IDENTITY column. However, it now seems to be returning DECIMAL.

A quick investigation shows that DECIMAL can indeed be used as an IDENTITY column. There is a restriction that the scale must be zero, i.e. DECIMAL(n,0), so that the field only contains whole numbers.

Exciting? Maybe not. Interesting? Evidently enough for me to blog it.

Technorati tags: ,


Caution! Hot Taps!

The office I’m working in has a notice above each sink:

"Caution! Beware of hot taps. The hot taps have been pasteurised and all water outlets will be very hot."

Surely it is the water that has been pasteurised, not the taps?


Polish Bathroom Fitter

We recently had our bathroom stripped bare and refitted. Pink wallpaper became white tiles, the acrylic bath with a hole became a whole enamel bath. That sort of thing.

The company we had in to do the fitting presented us with two faces: Ray, the South African boss (or mere line manager, but I suspect they’re not that huge an operation) and Adam (or ‘Adamski’ as Ray said at one point), a Polish all-rounder in the game of bathroom fitting.

Things were progressing really well, and a nine day job was scheduled to be finished in six and a half. Adam had been very hard working, an amiable and cheery chap, but a little difficult to communicate with. His English was languishing somewhere south of Peter and Jane books. Ray provided telephone and in-person support for the more difficult exchanges. 

On the morning of completion and pursuant to the advice of my father, I started the process of snagging in preparation for winding up the operation. One thing I wouldn’t have thought to do without the paternal advice was to check that the bath overflow worked. I filled the bath and kept the taps running. The overflow was working brilliantly; the water was hardly rising past it. With the test concluded, I headed down to the kitchen for breakfast.

As you will have predicted, that’s when I saw the drips from the ceiling. These were followed shortly afterwards by streams of water coming out from the window frames and pooling inside and outside the house.

There was a knock at the door: Adamski had arrived. I rushed to let him in and raced to think of how I could communicate the issue at hand. I hit on one of the few words he knew, "Problem!", and led him through to the kitchen. On seeing the water works he used one of the other words he knew, "Shit!", and raced upstairs to sort it out.

It seems that the overflow pipe had been loose and had simply detached itself from the bath. The water dribbled out the overflow, down the underside of the bath and into the floor, but it wasn’t a huge amount. The real problem was when I emptied the bath. The overflow pipe had flopped to the ground and was lying lower than the normal waste pipe did. The entire bath full of water had taken the easiest route out of the system and flowed out of the detached overflow pipe and onto the kitchen ceiling.

We were lucky that the flow took it into the wall, and it appears (several days after the event) that we’ve suffered no damage from the incident.

So now we have a new bathroom and an embarassed Pole from whom, to my thinking, we might be able to call in a favour in the future.

Computers and Internet

Microsoft Office Groove 2007 folder sync not supported for Vista x64

"Groove" is an offering from Microsoft to enable teams to collaborate by sharing documents and other items between colleagues within a company and customers/partners outside of the company. It provides a ‘workspace’ in which files can be shared. In a simpler mode, one can choose a folder in Windows Explorer and select to share it through Groove.

When using a workspace, there is some integration with SharePoint in that documents can be checked in and out of an accompanying document library, but SharePoint is not a requirement for Groove. Documents are available offline, unlike just using SharePoint, and synchronized when on line.

Anyway, the point of this post was just to highlight to people that if, like me, you went to the trouble of installing the 64 bit version of Vista, the folder synchronisation tool does not work. This feature, arguably the feature that gives the product a purpose in life, does not work for 64 bit OS’s. I hope this gets rectified soon.

In the mean time I am back to using "FolderShare" for, well, sharing folders. It seems to just work, no matter whether it’s Vista x64 or 32 bit Win XP. Microsoft own this tool too!


British Airways’ Token Gesture

You may recall the issues Julie and I had with BA losing our bags on our trip to Oslo over New Year’s Eve. The bags turned up 13 days after we left them with BA, with one of the two traveling back via Oslo and Milan. I complained to BA and detailed the cost of clothes and toiletries we’d had to buy out there. For the two of us it came to about £200. Obviously it’s great to have new clothes, but they were surplus to requirements and we would not have spent that money if we’d had our bags with us.

BA wrote back this week and informed us although they could not offer us compenstation there would be a cheque for £36.22 in the post. I’m left somewhat bemused. It’s a pretty specific figure that has no relation to our actual costs, that I can see.

So, do I write back? A BA employee at the airport said we’d get money back for everything we had to buy, but we didn’t get that in writing and I didn’t get her name. I can’t decide if it’s worth the effort.

(Update 20/3)

I wrote back and now they’re asking me to resend the receipts. They "hope I’ll travel with BA again". That depends on what they say in their next response!

(Update 25/5)

Last weekend we received a cheque for the remaining amount. So the lesson learned is never give up! The effort involved amounted to three letters, which is not much for almost £200 of compensation. Now I’m happy.

Computers and Internet

First impressions: VSTS 4 DB Pros


My notes on my first impressions of Visual Studio Team System for Database Professionals.


I installed VSTS for Database Professionals using the DVD image from MSDN. This also involved installing MSDN Library for Visual Studio; it seems the integrated help will only work with that version of the library and not the Jan 2006 one I had installed for integrating with Visual Studio 2003.


The first action I undertook was to use the wizard to create a new project. It asks for an instance of SQL Server and then creates a DB on that instance with a name of the form "<name-of-project>_DB_<some-guid>". This database instance is used by Visual Studio to perform validation of the model, and so I guess should not be tampered with!


The project creation wizard doesn’t prompt for a database to sync with, though it is possible to import schemas or sync with an existing database after the project creation wizard has completed.


When I add a table in the project in Visual Studio, it generates a CREATE TABLE script and a couple of dummy columns. Not a great design experience. I was expecting something more graphical. When I try and rename the columns, using the Schema View tab, this must be done via a ‘refactor’. When I later created foreign keys to a column, this feature (as expected) updated those foreign key scripts too. It also optionally creates a refactoring XML log under a hidden "Refactoring logs" directory in the project root. I cannot see where this is used yet.


If I want to do anything more complex than changing a column name then it means editing the SQL script for the CREATE table. This includes adding a column, changing a column’s data type, nullability, identity, etc. It doesn’t feel like you’ve got the full design capabilities of Management Studio in an offline mode. There also doesn’t seem to be any form of entity-relationship diagram capability, for those of us used to using Visio or Erwin to maintain our database schemas.


Choosing "Build" on solution explorer context menu for the project creates a script under a hidden "sql" folder in the project root. This script puts together all the individual scripts in the project to create a single deployment script. Individual scripts include tables, views, SPs, functions, post- and pre-build scripts, security scripts… the list goes on.


Choosing "Deploy" on the solution explorer context menu for the project results in a build followed by the deployment. The deployment creates a database named <name-of-project>. The end result is two databases of this name in the server.


At this point it seems easier to start using Management Studio to edit the database, at least for a lot of coarse grained tasks like creating tables from scratch and references between tables.


In order to synchronise these changes back into the project it is necessary to create a new "Schema Comparison". This compares a project with a database, or compares one database against another.


The default comparison assumes your "target", i.e. the thing you want to update to be the same as the "source", is a database. In my case I had made changes to the database named <name-of-project> and I wanted to reflect those changes in the project. There’s a handy button in the middle of the schema comparison window that switches source and destination around, though.


My changes to be compared and synchronised were trivial; added tables, renamed columns, added foreign keys. These were flagged as a list of update actions split down to the table level. A button in the toolbar allows all the changes to be applied to the target. Individual update actions can be skipped if necessary. It would be nice if the schema comparison refreshed to reflect the state of play after the updates had been applied, but it’s possible that on an enterprise level schema this would be a bit slow.


A nice feature of the schema comparison is that when an update action row is selected, "source object" and "target object" scripts are shown side by side with changes highlighted in various colours.


My investigations continue, but I though some might find these first impressions useful.