While I was maintaining one of our larger projects the other day, I came across something like this in an update trigger. I've anonymized the table and field names, but otherwise the logic is unaltered:

declare
  @id  int,
  @val_old  varchar(10),
  @val_new  varchar(10)

declare ChangeCursor  cursor  for  select  new.id,
   new.val,
   old.val
from deleted  old  join inserted  new  on  new.id =  old.id

open ChangeCursor

fetch  next  from ChangeCursor
into @id, @val_new, @val_old

while  @@fetch_status = 0
begin  if ( @val_new <> @val_old )
   begin  raiserror(  'The value may not be changed for ...
Our Falafel teammate Rick Miller had something to say about dedication and loyalty that brought a tear to my eye.



This message brought to you by the Falafel Peanut Gallery.

In case you hadn't noticed, there is a Beta of SP1 for Visual Studio 2008 and .NET Framework 3.5 out there. You should really check it out, it has tons of goodies, especially if you need some performance boosts in your WPF applications.

In this blog, I want to highlight a little hack that Microsoft added to the designer. In some instances, with complex nested Web Application Project solutions, the 2008 designer can not locate the master page. This used to be the case in 2005 designer too, but it would just show an error message for the master ...

Falafel Software today released its new TestCompleteTV.com web site, a subscription based video library to train on the award winning Automated QA tool, TESTCOMPLETE.  We are all very excited about the site and the possibilities it brings to our loyal customers worldwide.

Subscriptions vary from $39 for 3 months, to $99 for the whole year or $299 for lifetime membership.
Falafel intends to produce between 200 to 250 videos by the end of 2008.
We encourage all members in the community to send us their feedback and their wish list on what videos we should produce first.

testcomplete training logo



TelerikTV.com was released this week as a show site for case studies involving Telerik technologies.  Falafel Software is very pleased to have its flag ship product, ActiveFocus, be the first product showcased on the site.  I was interviewed by my friend Cark Franklin, co founder of the very successful .NET Rocks! Internet audio talk show for .NET Developers, for an hour, we discussed the elegance and power of the Telerik radControls and dived into source code to demonstrate the architecture and implementation of these amazing components.

Go view the video today and let us know what you think! :)...

I have been experiencing video lag in Camtasia 5.  It would seeming ly happen without rhyme or reason and was a progressively increasing lag where I could hear my voice talking about things I had not done in the video yet.  There are a few remedies that seem to fix the problem or at least help, and I will list them here.

1) If the audio is thrown off after producing the video but looks fine when reviewing it before it is produced, make sure you are including an index during production.  The option can be seen in th ecustom ...

There once was a time when I would have said that you can't write queries that are both high-performance and easily maintainable. I believed that temp tables were a crutch for the weak, and that a gigantic query with lots of nested subqueries would run more efficiently than the same query broken into multiple parts, using intermediate temp tables to pass information from one query to the next. And now I'm here to tell you that I was wrong.

Experience has taught me that big, monolithic queries are not only much more difficult to maintain, they run slower, too. You ...

In a Windows Presentation Foundation (WPF) application, you are only allowed to update UI objects in the thread that created them, which for UI objects will be the main UI thread.

If you have code that needs to check whether it is in the correct thread or not before updating the UI, you can use the CheckAccess method of DispatcherObject, which is the base class of all UI elements (via Visual, and DependencyObject). CheckAccess will return false if you may not update the object that you called CheckAccess on from the current thread (there is a related method, VerifyAccess, which ...

Found quite a gem today.  I've always installed the Windows Powertoys feature to get the "Open Command Window here" option when you right-click a folder in Explorer.  I've discovered that this is not needed in Vista.

How does that saying go..."Real men use DOS, right?"  I can never seem to get completely away from needing a Command Shell for batch file testing, etc.  The problem is trying to navigate quickly in a DOS box to a deeply nested directory.  For Vista, there's a similar product called TweakVI as seen here:

http://www.totalidea.com/content/tweakvi/tweakvi-index.php

It's got most of the features of the old Powertoys ...

This is actually right in the SQL Server Books Online, but not easily found. Given a temp table named #temp:

if ( object_id(  'tempdb..#temp' )  is  null )
     -- table doesn't exist  else  -- table exists  

Here is an interesting article on a way to turn many looping row-based operations into set-based ones: http://www.sqlservercentral.com/articles/TSQL/62867/

I think the idea is a clever one, and I love the "Row By Agonizing Row" (RBAR) acronym!

I'm a big fan of the Opera browser for its speed and excellent out-of-the-box functionality. One of the few things I have been willing to concede that it was lacking was a good interactive debugger like FireBug, until now. Opera Dragonfly has arrived!

Consider how many times we’ve run into the following scenario:  We’ve got a GUI design, say, a simple WinForm.  Upon interaction with the form, we need to launch a CPU-intensive operation, one which might take a while.  At some point the operation will complete and we want the result to show on the form.  That’s where the problem starts...

We’ve all seen this before – the GUI becomes unresponsive while the operation takes place.  This is because we are violating the following rule:

“Never execute a long-running piece of code in the UI thread”

as ...