Follow Me : https://www.youtube.com/c/SauravAgarwal
REPLACE(string, string_replaced, string_replace_with)
47. What are the three different types of Error Handling?
1. TRY CATCH
The first error encountered in a TRY block will direct you to its CATCH block ignoring the rest of the
code in the TRY block will generate an error or not.
2. @@error
stores the error code for the last executed SQL statement. If there is no error, then it is equal to 0.
If there is an error, then it has another number (error code).
3. RAISERROR() function
A system defined function that is used to return messages back to applications using the same format
which SQL uses for errors or warning message.
48. Explain about Cursors ..?
○ Cursors are a temporary database object which are used to loop through a table on row-by-row
basis. There are five types of cursors:
■ 1. Static: shows a static view of the data with only the changes done by session which opened the
cursor.
■ 2. Dynamic: shows data in its current state as the cursor moves from record-to-record.
■ 3. Forward Only: move only record-by-record
■ 4. Scrolling: moves anywhere.
■ 5. Read Only: prevents data manipulation to cursor data set.
Do'stlaringiz bilan baham: