Some very old pix of me and mi pals at Telnet Basement working with SoftWorks Limited.
Tuesday, July 14, 2009
Duplicate Filtering in SSIS
Having being frustrated on lack of duplicate filtering in SSIS, I decided to take a work around, first dump the data in a temporary table and pick it up with "select distinct … “ in the next task. This work around works though but fails in instances that the filter had to be applied on some of the columns selected unlike “select distinct ..” that applies across all the selected columns.
Alas!!! SSIS provides this in the Sort Task and can be applied just as I want it in my project. Simply select the columns you want to filter on as the sort keys and check “Remove rows with duplicate soft values”. Voila! problem solved.
IMHO, I consider the sort task an overkill for this purpose but no other alternative unless the developer will not mind building a dedicated filtering task for SSIS. SQL Central provides samples on how to build SSIS task.
Monday, July 06, 2009
Multipoint Collaborative Application
A client walked up to me after a recent presentation asking how to go about having a collaborative multi-mouse based application. I pulled back a bit before responding, quickly kicking around in my head. What will happen if I got multiple input device (mouse devices) in Windows? It should just work. Notebooks has had this features for years and it just work but then I gotta see what happens if I got more mouse.
Secondly, if it does work, how do I differentiate which device is in control in an application. They both most likely will generate same Windows event. – brain dead lock.
“Ehmm“ I fumbled to respond. “It’s possible but I can’t give you a solution straight up. Can we talk about this again in a couple of weeks.”
I bought an extra USB mouse device (already got a Mogo mouse) on my way home. Connected this up to a notebook and it all worked. All controlled same mouse as expected which left me with the second question. “How do I differentiate this in an application”.
Of course, Google to the rescue. After hours of google(ing) it with B’ing, I came across this article by P. Opdahl from on CodeProject.
It’s quite an interesting Read and done with C++(Not so happy about that, so quick to understand C#, VB and Python these days). I search some more and and more and came across Microsoft Multipoint SDK. How could I have missed this?
SDK is installed with sample application of which I find the Quiz sample most interesting.
The Microsoft Multipoint SDK can be downloaded here. Note: This won’t install on Windows 7 unless maybe you install in XP-Mode. I don’t have Intel-VT so this is no option for me.
More Resources
Thursday, July 02, 2009
Record Value Frequency In SSIS
I blogged last week about a problem on Record Value Frequency in SSIS. I suggested in the blog post on how to go about taking care of this.
“The only way I could see out of this is to write a CLR function to achieve this which I am feeling so lazy to do but still has to be done.”
This I finally had time to do and pasted below is the simple CLR User Defined Functions (UDF)
static readonly Dictionary<SqlString, SqlInt32> myDic = new Dictionary<SqlString, SqlInt32>();
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString SvSequence(SqlString colValue)
{
SqlInt32 nextValue = 1;
if (myDic.ContainsKey(colValue))
{
myDic[colValue] += 1;
nextValue = myDic[colValue];
}
else
myDic.Add(colValue, 1);
// Put your code here
return nextValue.ToSqlString();
}
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString RestartSequence()
{
myDic.Clear();
return new SqlString();
}
Notice the readonly used in the static declaration for the dictionary. This is enforced by the compiler for static class member as a requirement. I also had to create a reset function which IMHO is not that cool but I need a way to reset this as the value kept increasing each time the UDF is called.
dbo.RestartSequence ;
select AccountId, dbo.SvSequence(AccountId) from dump
PDC 2009
I have always known that PDC event will be in November but not sure if the date has been fixed. Today, I had to start writing plans for November and realized I have no idea of the actual date.
After some Googling with ‘Bing over the net, found the dates to be from Tuesday, November 17th through Thursday, November 19th. Not so excited that it’s going to be in LA (LAX Convention Centre) again!. Would have preferred some other city like San Francisco or any other cool place Microsoft may think up.
Do join the wave @pdc09 and search for the tag name #pdc09 for the excitement buildup. Also register for the mailing list.
Mike Swanson had so much to say about it in his blog.