View Single Post
  #2 (permalink)  
Old November 12th, 2011, 08:48 PM
Paul_Turley Paul_Turley is offline
Wrox Author
Points: 183, Level: 3
Points: 183, Level: 3 Points: 183, Level: 3 Points: 183, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Vancouver, Washington, USA.
Posts: 61
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're absolutely right. I beleive that when the stored procedure script was pasted into the manuscript, the last line was omitted. My appologies. The code should read:

CREATE PROCEDURE spUpd_MyContacts
@ContactID int
, @FirstName nvarchar(50)
, @LastName nvarchar(50)
, @Phone nvarchar(25)
AS
UPDATE MyContacts
SET FirstName = @FirstName
, LastName = @LastName
, Phone = @Phone
WHERE ContactID = @ContactID


Regarding your second question, any column or combination of columns can be used in a WHERE clause to qualify records. Just keep in mind that only the primary key is used to guarantee uniqueness.
__________________
Paul Turley
Mentor | SQL Server MVP, SolidQ
Blog: sqlserverbiblog.com
Author: SQL Server Reporting Services Recipes for Designing Expert Reports; Professional SQL Server Reporting Services (2000, 2005, 2008 & 2012), Beginning T-SQL (2000, 2005 & 2008), SSIS, SSAS & Access
Reply With Quote