jQuery Picklists Plugin (update)

by kkikta 8. October 2009 21:25

A couple of days ago I found a pretty cool jQuery plugin for doing two select boxes called picklists. I started using it but immediately noticed one feature was missing from it, when the list is loaded it doesn't load "selected" items into the second list. First I tried to hack some code to move the stuff and although I got it working I decided that wasn't really the right solution. Anyway I've add the setting "preload". When its true items that are selected at the time picklist plugin is loaded are added to the selected list so now its a pretty cool tool for .net/cf/php/etc. When the setting is false it does the same as it did before (the selected items list is blank). Anyway enjoy! ;P

 jquery.picklists.js (4.75 kb)

Tags:

.NET | ColdFusion | General | JavaScript

SQL Server string join

by kkikta 6. October 2009 13:55

Today our dev team asked the question "Is there a way to join strings in SQL server from a table output?" Immediately the DBA and I said yea concatenate. Well while that may be possible this might be an easier way. At first I though that using a select @var = @var + text would not concatenate across the table but it does.

Ex.

declare @blah table (text varchar(max));
insert into @blah values ('a');
insert into @blah values ('b');
insert into @blah values ('c');
insert into @blah values ('d');

declare @join varchar(max)
set @join = ''
select @join = @join + text + ',' from @blah
select substring(@join, 0, len(@join))


Next the question arose could this be turned into a function to which our DBA promptly stated no being that table variables can not be used as function parameters. So we thought about it for a min and decided although its a cheezy work around we could use a temp table. Since a temp table exists for the function/procedure call and sub functions and procedures unlike table variables which are not available to subroutines. Unfortunately since dynamic SQL is not allowed in functions, so it would have to be a proc. Unless its possible in a CLR function.


Tags:

General | SQL Server

Month List

Page List