locked
obtain default values for stored proc parameter in ADO.NET? RRS feed

  • Question

  • Is is possible, directly, or by executing SQL code, to obtain the default value for an imput parameter declared in a stored procedure?

    eg

    CREATE PROCEDURE [test]
    (
     @test nvarchar(255) = "some default value"
    )
    AS

    INSERT INTO test (test)
    VALUES (@test)
    GO

    I want to get the "some default value" value from my application.

    Friday, June 24, 2005 3:54 PM

Answers

  • Hi,



    IMO, its not possible since the scope of the variable in your SP is local. Not unless that you would return the value in a parameter. Or converting it into a UDF(User Defined Function) and directly return it's value...






    cheers,




    Paul June A. Domag
    Saturday, June 25, 2005 8:19 AM