Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2003
    Posts
    111

    Unanswered: Query Analyser QUestion

    Hi all

    I am a novice to SQL Server 2000
    Is there a quick reference somewhere for using Query Analyser??

    I need to declare variables and pass them into a store procedure.

    say if i have the following procedure showing only the input variables/

    CREATE PROCEDURE CalcLocalTime
    (
    @postcode int,
    @sDate datetime

    )


    also how do i display a return variable?


    James

  2. #2
    Join Date
    Aug 2003
    Posts
    111
    I did something like


    execute CalcLocalTime '2000', '11/3/2004';

    but it doesn't know how to implicitly convert a string date to a datetime type.



    James

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    try the convert function... or the cast function.

    alternatively call the stored proc like this...

    execute CalcLocalTime @postcode=2000, @sDate='11-Mar-2004'

  4. #4
    Join Date
    Aug 2003
    Posts
    111
    thanx

    i found out the error, it was just that the date string was not a valid string

    instead of
    execute CalcLocalTime '2000', '11/3/2004';
    i put
    execute CalcLocalTime '2000', '11/MAR/2004';



    James

  5. #5
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    Yup, that was what the error message meant.

    The other bits I changed put made things more specific.

    Glad you solved your problem though.

Posting Permissions

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