Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional SQL Server 2005 Administration ISBN: 0-470-05520-0
This is the forum to discuss the Wrox book Professional SQL Server 2005 Administration by Brian Knight, Ketan Patel, Wayne Snyder, Jean-Claude Armand, Ross LoForte, Brad McGehee, Steven Wort, Joe Salvatore, Haidong Ji; ISBN: 9780470055205
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SQL Server 2005 Administration ISBN: 0-470-05520-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 15th, 2007, 03:59 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default CH 15 - SP GetDOB is missing

Hello

I am trying to read through chapter 15 which discusses SQL 2005 indexes. I am setting up the people database for the examples and I beleive that the GetDOB stored proc is missing. I would be grateful if someone could point me at the code for this missing procedure so I can carry on with my study. Many thanks in advance

  #2 (permalink)  
Old May 1st, 2007, 09:10 AM
Wrox Author
 
Join Date: Dec 2006
Location: kirkland, wa, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Enrico

Thanks for buying the book, and taking the time to work thru the examples.

Here is the GetDOB SP

If you find anymore SPs are missing please let me know, and I'll try and get them posted here a bit faster next time.

USE [People]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

create proc [dbo].[GetDOB] @DOB datetime output as
begin
    -- generate DOB's
    declare @dayofYear int, @yearOffset int, @BaseYear int, @startDate varchar(12) -- , @DOB datetime

    select @BaseYear = 2006 - 110

    select @dayOfYear = rand() * 365, @yearOffset = rand() * 110
    select @startDate = '1 Jan ' + convert(varchar(4),(@BaseYear + @yearOffset))

    select @DOB = dateadd(dd,@dayOfYear,@startDate)

end


Steve Wort
Co Author "Professional SQL Server 2005 Administration"


Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 15 - Security aspcoder BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 May 3rd, 2008 02:55 PM
CH.15 NEED HELP stacy BOOK: Beginning ASP 3.0 1 January 21st, 2004 03:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.