reference table for errors

  • Hello everyone

    I have on each table of my base two columns used to store my anomalies Functional [error_id] and [description_error]

    create table produit
    (
    id int ,
    nom varchar(50),
    id_erreur int ,
    description_erreur varchar(50),
    )

     

    create table magazin
    (
    id int ,
    nom varchar(50),
    id_erreur int ,
    description_erreur varchar(50),
    )

    I would like to store all my errors with their descriptions with the name of the source table in a single reference table by going through all the error_id the table reference error is the following

    create table list_erreur
    (nom_table varchar(50),
    id_erreur int ,
    descritption varchar(50)
    )

    Who has an idea please

    Thank you for your return

    1. Check how you've spelt "description" in your list_erreur table
    2. Remove the description_erreur column from the rest of your tables
    3. Create a foreign key constraint between the id_erreur column in each of the rest of your tables and the id_erreur column in your new table
    4. Change your application logic so that it no longer provides a value for the description column

    John

  • Instead of providing us with a list of requirements and forcing us to play "guess the question", why not ask us something specific?

    The absence of evidence is not evidence of absence
    - Martin Rees
    The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
    - Phil Parkin

    • Is the errors from database procedures/functions or from outside the database?
    • Do you use a stored procedure to save the error?
    • Do you not need a timestamp of the error?

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

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