Welcome!

Steven Mandel

Subscribe to Steven Mandel: eMailAlertsEmail Alerts
Get Steven Mandel via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn


Article

.NET Book Review: Murach's SQL Server 2005 for Developers

If you're new to SQL Server 2005 you'll gain a lot from this book

I do have some minor gripes with the book though. First, it continues to show examples of the between function with regard to dates and implies that a statement like

WHERE OrderDate BETWEEN '11/1/2007' AND '11/30/2007'

will give you all the orders placed in November 2007. This isn't true unless your time is set to 00:00:00 since there's no separate date variable, only a datetime variable. The correct syntax should be something like

WHERE OrderDate BETWEEN '11/1/2007' AND '11/30/2007 23:59:997'

or

WHERE OrderDate >= '11/1/2007' AND OrderDate < '12/1/2007 00:00:000'

My other gripe is in the chapter on CLR Stored Procedure development. The authors have no discussion of the use of "context connection" when running T-SQL stored procedures. The context connection lets you execute Transact-SQL statements in the same context that your code was invoked in the first place. Using a "Context Connection" connection string tells the SqlConnection object to connect to the existing context inside SQL Server. Since this code will run inside a stored procedure inside SQL Server we don't need to "relogin." To obtain the context connection, you must use the "context connection" connection string keyword, as in the example below:

Using connection as new SqlConnection("context connection=true")

     connection.Open() ' Use the connection

End Using

In conclusion, if you're new to SQL Server 2005 then this book will make a valuable addition to your collection. If you have worked with SQL Server 2000 in the past, you still might want to have one or two copies around at the office for reference.

  •   Murach's SQL Server 2005 for Developers
  •   Authors: Bryan Syverson, Joel Murach
  •   Publisher: Murach, Mike & Associates, Inc.
  •   Pub. Date: December 2006
  •   ISBN-13: 9781890774394
  •   Pages: 702
  •   Level: Beginner-Intermediate
  •   Languages: T-SQL , VB.NET
  •   Software: All Versions of SQL Server 2005

More Stories By Steven Mandel

Steven Mandel has worked in the IT industry for over 15 years designing databases using Microsoft Access and SQL Server. He has developed Web and Windows applications using VB.NET and has written numerous articles and reviews about ASP.NET and VB.NET.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.