stored procedure help

  • 1) create below mentioned table:

    Material (materialid, supplierid, tenantid,mcode, is active, createdon) value is the date and time in which row is inserted.

    uniquekey (mcode, tenantid)

    ,isactive is Boolean type and createdon default

    dbo.

    Supplier(supplierid, suppliercode, tenantid, isactive, createdon) value is the date and time in which row is inserted,

    unique (suppliercode, tenantid) isactive is Boolean type and createdon default

    Material_uom(material_uomid, materialid, uom, uomqty)

    uniquekey (materialid,uom)

    Tenant (tenantid, tenantname, createdon, isactive) time in which row is inserted.

    isactive is Boolean type and createdon default value is the date and

    2) write a procedure to insert one material in table and also handle exceptions. (It is mandatory to have one uos for each items ). inputs(supplierid, tenantid,code)

    after writing the procedure, please provide execute statement in order to get result.

    3) write a Procedure to get the Suppliercode, tenantname as one result and code, uom as second result.

    after writing the procedure, please provide execute statement in order to get result.

    • This topic was modified 2 years, 3 months ago by  yemjalpawan.
  • Is this a blog post, or do you have a question?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • School assignment I presume.

    Johan

    Learn to play, play to learn !

    Dont drive faster than your guardian angel can fly ...
    but keeping both feet on the ground wont get you anywhere :w00t:

    - How to post Performance Problems
    - How to post data/code to get the best help[/url]

    - How to prevent a sore throat after hours of presenting ppt

    press F1 for solution, press shift+F1 for urgent solution 😀

    Need a bit of Powershell? How about this

    Who am I ? Sometimes this is me but most of the time this is me

  • yemjalpawan wrote:

    1) create below mentioned table:

    Material (materialid, supplierid, tenantid,mcode, is active, createdon) value is the date and time in which row is inserted.

    uniquekey (mcode, tenantid)

    ,isactive is Boolean type and createdon default

    dbo.

    Supplier(supplierid, suppliercode, tenantid, isactive, createdon) value is the date and time in which row is inserted,

    unique (suppliercode, tenantid) isactive is Boolean type and createdon default

    Material_uom(material_uomid, materialid, uom, uomqty)

    uniquekey (materialid,uom)

    Tenant (tenantid, tenantname, createdon, isactive) time in which row is inserted.

    isactive is Boolean type and createdon default value is the date and

    2) write a procedure to insert one material in table and also handle exceptions. (It is mandatory to have one uos for each items ). inputs(supplierid, tenantid,code)

    after writing the procedure, please provide execute statement in order to get result.

    3) write a Procedure to get the Suppliercode, tenantname as one result and code, uom as second result.

    after writing the procedure, please provide execute statement in order to get result.

    Just a keepsake... these tend to disappear.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I don't have a degree. Will I get the degree if I answer the question?

    "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

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

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