Block create temporary stored procedure

  • Hello

    I would like know how block to create a temporary stored procedure in SQL Server, versions 7 and 2k.

    Nowadays, someone can to create using the command

    create procedure #sp_name

    Trully

    José Ricardo Oviedo Ferreira

    jose.oviedo@uol.com.br

  • i just connected to a SQL 2000 instance and ran this code without errors; it returned the expected value; i don't have a SQL7 instance anymore.

    select @@version = Microsoft SQL Server 2000 - 8.00.760 (Intel X86) Dec 17 2002 14:22:05 Copyright (c) 1988-2003 Microsoft Corporation Personal Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

    CREATE PROCEDURE #MyPhoneNumberFormatter(@NUMBER varchar(20))

    AS

    BEGIN

    IF LEN(@NUMBER) = 7

    SET @NUMBER=STUFF(@NUMBER,4,0,'-')

    SELECT @NUMBER

    END

    GO

    Exec #MyPhoneNumberFormatter '8789961'

    does that help?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply