Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2005
    Posts
    74

    Unanswered: Help understanding Stored proc

    hi guys! Can anybody please explain what does lines 4,6,8,13 and 26 does? Thanks in advance!

    Code:
    1 USE [PawnShoppeDB]
    2 GO
    3 /****** Object:  StoredProcedure [dbo].[sp_Customer_AddCustomer]    Script Date: 06/14/2007 16:50:07 ******/
    4 SET ANSI_NULLS ON
    5 GO
    6 SET QUOTED_IDENTIFIER ON
    7 GO
    8 ALTER   Procedure [dbo].[sp_Customer_AddCustomer]    
    9  @Customer_FirstName  varchar(50),    
    10 @Customer_LastName  varchar(50),   
    11 @Customer_MiddleInitial varchar(5),   
    12  @Customer_Address  varchar(100),
    13   @Identity int output    
    14 AS   
    15 Begin  
    16 Declare @DateCreated DateTime  
    17 Set @DateCreated = getDate()  
    18  
    19   Insert into RCPS_Customer    
    20    Values (@Customer_FirstName,  
    21   @Customer_MiddleInitial,    
    22      @Customer_LastName,    
    23      @Customer_Address,  
    24   '0',@DateCreated)  
    25  
    26 	Set @identity = Scope_identity()
    27 End

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Lol.

    Check books online (SQL Server help) for:
    ANSI_NULLS
    QUOTED_IDENTIFIER
    Scope_identity()
    output parameters

    Alter proc replaces an existing proc with the same name with the code you posted. That'll be in the help files too.
    Testimonial:
    pootle flump
    ur codings are working excelent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •