Comparing strings with trailing spaces

select top 1 * from database.dbo.table WHERE 1=0 — returns no results

— makes sense

select top 1 * from database.dbo.table WHERE 1=1 — returns 1 row

— yep

select top 1 * from database.dbo.table WHERE ‘frog’ = ‘frog’ — returns 1 row

— cool

select top 1 * from database.dbo.table WHERE ‘frog’ = ‘frog  ‘ — returns 1 row

— eh!!?

Apparently it’s by design – http://support.microsoft.com/kb/316626

I didn’t know that!

Exporting user list from SharePoint 2010

Here’s the magic URL – Just replace the bits in square brackets with the appropriate values for your site

http://[YOURSITE]/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[LISTID]&View=[VIEWID]&CacheControl=1

[YOURSITE] – This is the main root of your SharePoint url

[LISTID] and [VIEWID] – Get these by going to ‘Site Actions’ -> ‘Site Settings’ -> ‘People and Groups’.  Click on ‘Settings’ -> ‘List Settings’ then down at the bottom under ‘Views’ click on ‘List View’.  Now look in your URL and you will see ‘List=’ and ‘&View=’ – These are the GUIDS you need for LISTID and VIEWID.

Once you have constructed your URL in notepad, paste it into internet explorer and hit enter – This should then prompt you to open or save the results – Click open and follow the instructions in Excel.

Changing object ID in SSAS BIDS

Developing an analysis services database in BIDS – You have created a dimension for example based on a table in your dsv called frog

You now want to rename this (for reasons that are entirely your own!) – Changing the name is easy via the properties but changing the ID is a bit trickier.

The trick is to right click the object (in this case the frog dimension) in BIDS and select ‘view code’ – You can then edit the ID here in the first couple of lines.