How to inherit properties of database column in procedure/Function?

  • Hi All,

    I need to know what is the equivalent syntax in SQL Server for the following ORACLE synatx,

    eg:

    Declare

        Lvno   employee.empid%type;

        Lvname employee.ename%type;

        LvHod   employee.hiredate%type;

        Lvrow   employee%rowtype;

    -- Lvno,name,hod  inherits the employee table column(s) datatype, length(presicion,scale)  

    -- Lvrow inherit all the columns in employee table

     

  • This was removed by the editor as SPAM

  • As far as I know there is no direct equivalent to this in SQL Server.  You can use sp_help <tablename> to generate a list of column names and their types (or write an equivalent script), then copy and paste them into your script.

     

    HTH

  • hi all,

    Grasshopper's solution will not work out, since inheritance is something like when you change the column width at database level you need not to bother about procedure/function which uses that column, automatically sp will take the column property, any change at column level will not affect frontend.

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

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