What is the difference between a stored procedure and a view? why do we use views from SQL Server point of view? What are mutating triggers? How is the structure of a bit map index, clustered, Non clustered and B Tree What re mutating triggers? Can a stored procedure a record set? Can we use DTS on a client machine to schedule jobs and consolidate data to a sql tables? Can we have an update trigger within another update trigger?
RE: What is the diff b/w a stored procedure and a view...
Hi Can we run select query by joining virtual table (view or logical table) and actual table (physical)? Or it just doesnt make sense to do and the same can be accomplished by joining the actual table itself.Thanks -ashruf
RE: What is the difference between a stored procedure ...
Difference between a stored procedure and view:
Well both of them aren't even compatible to compare and tell the difference. They both belong to different paradigm of database world. Anyways here are the definitions I would give you. A stored procedure is a set of sql statements which can be called a subroutine to access relational database systems. Its actually stored in a daatabase. They are mainly used for faster access(Pre-compilation of SQL statements) Simplification of data management and for security.
A view as my friends have elucidated above is a virtual or logical table that holds result set of a pre-defined query. The data for these views are not stored in the database. There are two types of view read only and updatable. You can modify a read only view with an INSTEAD OF trigger.
RE: What is the difference between a stored procedure ...
Mutating triggers :
I am not aware of mutating triggers in SQL Server. Per my knowledge only MySQL and Oracle throws this error. Coming back to the point mutating trigger occurs when the table which fired the triggering event is being accessed in the body of the trigger code directly or indirectly through a nested trigger or procedure etc. This is not allowed as the table could be in a middle of transaction.
RE: What is the difference between a stored procedure ...
Clustered Index:
A clustered index reorders the way data is physically stored in a disc. Thats why there can be only one clustered index on the table. The leaf nodes of the index contains the data pages. Non-clustered Index:
A non-clustered index is an in which logical order of the index do not match with physical order of data stored. In this case the leaf node do not contains data pages but contains indexed rows.