Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2006
    Posts
    111

    Unanswered: Stored Procedure parameter

    In the Create portion of a stored procedure, does the line in bold mean
    that if the parameter @RegoDate is not provided, then use the current datetime?

    Code:
    CREATE PROCEDURE spGetRegoDetail
      @Owner nvarchar(20),
      @RegoDate datetime = getdate
    AS ...
    Thanks in advance,
    G11DB

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    What bold line?
    Are we using MSSQLServer, MYSQL, etc?
    I suggest that the thread gets moved to the appropriate topic so g11DB can get the answers (s)he needs!
    Code:
    --Here's a stab in the dark
    DECLARE @RegoDate As datetime
    SET @RegoDate = GetDate()
    PRINT 'Before ' + @RegoDate
    SET @RegoDate = '01/01/2001'
    PRINT 'After ' + @RegoDate
    -- Is the variable overwritten?
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    yes, g11DB, that's what that means

    thread moved to sql server forum
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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