Adding columns in a stored procedure

2 posts, 0 answers
  1. Eric
    Eric avatar
    4 posts
    Member since:
    Jul 2014

    Posted 26 Jan 2015 Link to this post


    In some of our code, we have to access a database that we're not in full control of. If we use the Data Access ORM product, will we need to update the model if a column is added to a stored procedure's output? Or will it keep running and just ignore the new column?


  2. Doroteya
    Doroteya avatar
    497 posts

    Posted 28 Jan 2015 Link to this post

    Hello Eric,

    In the situation you describe - a column is added to the result shape of a procedure while the application is running, the application is not going to throw errors after the change in the database and it will not respect the new column in the result as well. In other words, the method that executes the stored procedure will continue to materialize the result to the same class as before. To change the result shape, you will have to update the stored procedure in the model and the class to which the result shape is mapped.

    If this is feasible to you, you can achieve the necessary result using the following steps:
    1. Update the stored procedure with the help of the Update From Database wizard.
    2. Regenerate the domain method that executes the stored procedure using the steps from this article, if it was created before with Domain Method Editor,
    - or -
    Manually update the class to which the result is materialized.
    3. Save the model and rebuild the application.

    I hope this helps. Let us know, if you need further assistance.

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
  3. DevCraft banner
Back to Top