WITH N AS(SELECT*FROM(VALUES('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9'))s(n))
UNION ALL SELECT LEFT(stuff(s,i,1,n),81),patindex('%0%',stuff(s,i,1,n))FROM S,N WHERE i>0 AND
NOT EXISTS(SELECT 1FROM N WHERE M.n=substring(s,(i-1)%9/3*3+(i-1)/27*27+(n-1)/3*6+n,1)
SELECT*FROM S WHERE i=0
As said, the minimum solution in characters, removal of the unnecessary white space, will give a single line with 461 characters.
Short 'description', the puzzle is given in the string of 81 positions, the fields with a zero are 'empty' fields. On the same line, the value before the i is the position of the first zero in the string.
As said, the minimum solution in characters (in SQL), not build for speed, but it's pretty speedy also. Not build for elegance, but I must say it is fairly elegant. The motivation was to showoff SQL as a very potent tool and to showoff that set based tools can be very power full. Here the solution is 'data' driven, not procedural driven.
later on I'll post a more extensive description. If the solution is allready self explaining for some, this would be nice.