Sql server updating data in a view

5 (one of the great strengths of stored procedures is that you can have long transactions of sql statements and conditional loops which can be all committed at once or rolled back as a unit. 2 (note most databases allow to define optional arguments, but this can become very unwieldy to maintain if there are a lot because you end up duplicating logic even within the stored function so is generally avoided) 4 –For databases such as SQL Server, Postgre SQL, DB 2, Oracle that allow return tables and sets, you can selectively pick fields you want from within a query.So although the function always outputs the same number of fields, you can selectively use only some similar to what you can do with views.The main beauty of a view is that it can be used like a table in most situations, but unlike a table, it can encapsulate very complex calculations and commonly used joins.It can also use pretty much any object in the db except for stored procedures.MS Access has a fairly sophisticated update algorithm for queries in that it automatically makes one table and even multi-table queries updateable and allows deletes if you define primary keys appropriately.Also depending on the field a column comes from it will update that and also automatically create child records in child tables if you try to update a child column when there is no record.In the next couple of sections we’ll cover stored procedures and these other kinds of database objects and detail the strengths and weaknesses of each for encapsulating logic.We will give a rating of 0-5 for each feature 0 meaning the feature is non-existent, 5 meaning this object is one of the best suited objects for implementing this kind of task.

We think it is important to consider each functional task of an application separately rather than thinking of an application as a whole.One approach is not strictly the best solution for all business requirements.In the next couple of sections we'll outline what are the important questions to consider when choosing one approach over another.You will find that they are very similar to stored functions in that they can return data; however stored procedures can not be used in queries.Since stored procedures have the mechanism of taking arguments declared as OUTPUT they can in theory return more than one output.

Leave a Reply