Parameter datatypes linked to underlying table column datatype

  • Hi,

    In Oracle when i create any procedure i define parameter datatype linked to under lying table.

    For ex

    create procedure testprocedure

    (param1 customer.name%type,

    param2 customer.salary%type )

    Here i have defined param1 and param2 with datatype of name and salary of customer table respectively.

    This way i do not need to worry about modifying param1 and param2 datatypes when datatypes of name & salary of customer table changes in future.

    How can i accomplish this in SQL server.

    I appreciate your response.

  • Lookup the data types of the underlying columns and then manually set them. That's the only way.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Sadly, you can't do that directly in SQL Server.

    The only way to simulate that would be to use alias data types -- lots of aliases.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

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

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