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

Views and Stored Procedures

1 Answer 47 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.
Christopher Blickley
Top achievements
Rank 2
Christopher Blickley asked on 04 Jan 2013, 07:39 PM
All:

I need to add a database (SQL Server) view instead of a table.  I can do that easily.  I am doing this so I can have a few additional fields included in the view that wouldn't otherwise be included in any object and are not part of the table.  I now need to map stored procedures to the view to do the update, create, and delete functions.  I see lots of references to this online, but with regards to the old menu options and reverse mapping screens that don't exist in the new domain model setup.

In the mapping window, I see where I can check off to map a stored procedure and it creates a stored procedure in the model when I check that off.  However, these stored procedures are not correct because they include all the fields in the view.  I really want to update just the fields that exist in the underlying table.  For example, I may have added a field from a lookup table.  That field doesn't get updated back into the database.

How can I either:

* Alter the stored procedures that it create
* Preferably, use my own stored procedures that I create.

Thanks,
Chris

1 Answer, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 07 Jan 2013, 10:53 AM
Hi Chris,

What you could do in order to use stored procedures, for handling the view CUD scenarios, is to alter the given stored procedures. You need to exclude the unneeded CUD operations on the view's custom columns from the stored procedure body.

Hope that helps. If any other questions arise, do not hesitate to contact us back.

Kind regards,
Damyan Bogoev
the Telerik team
Q3'12 SP1 of OpenAccess ORM packs Multi-Table Entities mapping support. Check it out.
Tags
General Discussions
Asked by
Christopher Blickley
Top achievements
Rank 2
Answers by
Damyan Bogoev
Telerik team
Share this question
or