I have been looking into the specification pattern that is briefly described in martin fowler's patterns of enterprise architecture under the repository pattern section, as well as several examples on the web. However, almost all of the examples/descriptions are created by utilizing an ORM and methods such as IsSatisfiedBy which are executed by the specification objects(and probably converted into SQL by the ORM).
I can see how you might adapt it to work with SQL, but due to a general lack of SQL examples, I was wondering if people are using this pattern with a SQL data access layer and the repository pattern, and their experience/approach with it if they are, or any alternatives that may be better suited to the task if there are any.
I believe that LINQ effectively implements the need to the specification pattern (I believe that this also ties into you request to work with SQL).
I suspect there are also APIs to spit out SQL without LINQ parse trees.
So, Entity Framework or LINQ to SQL would be worth looking into.
I hope this answers your question.