This is a migrated thread and some comments may be shown as answers.

Adding columns in a stored procedure

1 Answer 50 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eric
Top achievements
Rank 1
Eric asked on 26 Jan 2015, 06:47 PM
Hi,

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?


Thanks,

Eric

1 Answer, 1 is accepted

Sort by
0
Doroteya
Telerik team
answered on 28 Jan 2015, 01:05 PM
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.



Regards,
Doroteya
Telerik
 
OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
 
Tags
General Discussions
Asked by
Eric
Top achievements
Rank 1
Answers by
Doroteya
Telerik team
Share this question
or