Author Archive

Handfasting this weekend, Free…

Posted by at 25th April, 2011

Handfasting this weekend, Free Comic Book Day/Rocky/More the next weekend, then two weekends later, Disneyland!

Category : Uncategorized (0) Comment

#ElfQuest like you’ve never se…

Posted by at 4th April, 2011

#ElfQuest like you’ve never seen it..On April 6, the Pini elves come to life! Catch a sneak peek here: http://bit.ly/hyVZh0

Category : Uncategorized (0) Comment

WonderCon fb gallery now up – …

Posted by at 4th April, 2011

WonderCon fb gallery now up – it’s just the preview set, unprocessed and rough – http://on.fb.me/fGNquu #wondercon

Category : Uncategorized (0) Comment

Now you can block Group Chat Messages on Facebook

Posted by at 23rd February, 2011

Facebook users are now able to opt out of receiving Group chat messages. That option does in fact exist, accessible via the “Edit Settings” button on the group’s page.

Although Facebook’s addition of a more sophisticated Groups has added some beneficial privacy features, there have been numerous complaints, particularly when it comes to email and chat notifications. While the ability to send chat messages to any online group member might be great in some circumstances, as Group Chat allows any member to send messages to everyone in the group who’s online, clearly there can be some problems.

Category : Uncategorized (0) Comment

Converting a field from multiple rows to a single delimited return value t-sql

Posted by at 6th December, 2010

I did not realise that declared variables in SQL are effectively “static” when used in rowsets. That is, the following code:

create table roles(role nvarchar(50))
GO
insert roles
select ‘Administrator’ union
select ‘Editor’ union
select ‘User’
go

declare @roles nvarchar(1024)
select @roles = isnull(@roles + ‘, ‘, ”) + role from roles
select @roles
go

drop table roles
go

yeilds “Administrator, Editor, User“.

Now instead of returning rowset of roles for a user and then concatenating results in client-side code, I can just write a function similar to:

create function fnGetUserRoleVerbose(@userid int, @delim nvarchar(2) = ‘, ‘)
returns nvarchar(1024)
as
begin
declare @role nvarchar(1024)

select
@role = isnull(@role + @delim, ”) + roles.name
from
users
inner join users_roles
on users.id = userid
inner join roles
on roleid = roles.id
where
users.id = @userid

return @role
end

and then just do this:

string roles = (string) SqlHelper.ExecuteScalar(
myConnectionString,
CommandType.Text,
string.Format(“select dbo.fnGetUserRoleVerbose({0}, default)”, userId));

Category : Uncategorized (0) Comment

Recent Comments
  • simplyredheads: All you lovely redheads may like to check out www.simplyredh...
  • admin: Woot - I got a response. I didn't think that there wasn't pe...
  • cyclone: You said: "There’s nothing wrong with living in a small to...
  • MrsH: You're so right, Bill! Thomas Jefferson would roll over in ...
  • Escarlata@FaireNews.com: Thanks for sharing how Golden Gate went, Bill. It sounds lik...
Flickr