• Actually, I was just talking with Todd Carrier (you'll find him on the forum lists) yesterday about the need for a book that teaches T-SQL and includes practice work like a high school or college textbook.

    All the books that I have seen give you one example of each type of query and then maaaaybe give you a couple of examples of variations.

    This is fine if you basically know what you are doing and just need to fill in some blank spots. However, I don't think it is sufficient for learning T-SQL from scratch.

    Which is a long-winded way of saying, I don't have any good suggestions on books that focus just on learning how to write T-SQL. So below is what I can suggest not knowing your skill level.

    I generally like the books prublished by Wrox and they produce a book called Beginning Transact-SQL. That might be at the appropriate level. If you are used to writing code in other languages, then Vieira's books would probably give you what you need. If you haven't written any code, or did so a long time ago, then check out Forta's book. It is not terribly expensive so if it is too basic not much is lost. Also, you can usually find a copy of Forta's book most Barnes and Nobles and often you can find copies of Vieira's books.

    If you aren't familiar with Books onLine, that is a great resource. It is the documentation module that comes with SQL Server that everyone I know who works in SQL Server uses almost every day. In BoL you can scroll down to the examples to get ideas on how the actual code is written.

    Lastly, if you start getting comfortable with T-SQL the Inside SQL Server 2005 books on Querying and Programming are well-written and cover a lot of ground. I wouldn't recommend them as your first books though as the assume familiarity and experience with T-SQL already.

    Ken Henderson's Guru books for SQL 2000 are also very good but on the same high level.

    Good luck with it.