What is cursor ? And what is difference between Trigger ?
Answers were Sorted based on User's Feedback
Cursor is an Database object and retrive the rows from
database row by row ,
And it is maily use for ot reduce the network traffic
it contains 5 features
1.DECLARE the Cursor
2.OPEN the cusrsor
3.FETCH the cursor
4.CLOSE the cursor
5.DEALLOCATE the cursor
TRIGGER : IT is also an database object and You can
perform an anction Trigger will fire automatacallly.
like (DML,DDL)
They can cascade changes through related tables in the
database; however, these changes can be executed more
efficiently using cascading referential integrity
constraints.
They can guard against malicious or incorrect INSERT,
UPDATE, and DELETE operations and enforce other
restrictions that are more complex than those defined with
CHECK constraints.
Multiple DML triggers of the same type (INSERT, UPDATE, or
DELETE) on a table allow multiple, different actions to
take place in response to the same modification statement.
| Is This Answer Correct ? | 53 Yes | 10 No |
Answer / sanjay kumar dinda
Cursor is a database object used by applications to
manipulate data in a set on a row-by-row basis, instead of
the typical SQL commands that operate on all the rows in
the set at one time.
Trigger is a database object invoked automatically when any
event occured.
These aevents are
Delete, Insert, Update etc....
SQL server store the intermediate data into to dummy table
INSERTED and DELETED...
At the time of insert operation SQL Server STores inserted
rows into the INSERTED table and at the time of delete or
update SQL Server stores the information into DELETED dummy
table
| Is This Answer Correct ? | 19 Yes | 7 No |
Answer / adisha
CURSOR:
1.They are temporary work areas.
2.They are not stored independently in the database.
3.We can create cursor both implicitly and explicitly.
4.Cursors can take parameters.
5.They are used to process the result of query.
TRIGGER:
1.They are named PL SQL blocks.
2. They are stored in database.
3. They can be invoked automatically.
4. They cannot take parameters.
5. They are used to enforce data in dignity rules.
| Is This Answer Correct ? | 5 Yes | 1 No |
Explain the ways to controlling cursor behavior?
How to delete duplicate records based on single column from a table?
0 Answers Petranics Solutions,
Which are the new data types introduced in sql server 2008?
What is statement level trigger?
Wht is Stuff in sql ser
What does it mean if @@cursor_row returns a negative number?
How to create an index on an existing table in ms sql server?
Explain the usage of floor function in sql server.
Differentiate between mongodb vs. Sql server?
How to generate the Reports for the Database? I need an Example for it.Will we manually do this or else any script is there? Please let me know ASAP...
What are the different ways of moving data/databases between servers and databases in SQL Server?
what is a cursor and what is its use?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)