Sunday, February 27, 2011

SQL Server Interview Questions and Answers: Series 12

Question: What is the nesting level of triggers?
Answers: A trigger nesting is possible for up to 32 levels.
Question: What happens if a transaction is failed in nested transaction, then other outer transactions will execute or not?
Answer: If any transaction fails or rollback in the nested transaction results in roll back of all transaction.
Question: How to enforce index on a query?
Answer: You can use index hints and can force sql server to use that index while running the query.
Question: What is STUFF function in SQL Server?
Answer: Stuff function replaces the string at specified index in a string.
STUFF (Mainstring, positionfromwherereplacementstart, numberofcharcterreplaced, stringnewtobereplaced)
Question: What is REPLACE function in SQL Server?
Answer: Replace function replaces the search string for every occurrences of search string in main string.
REPLACE (mainstring, stringneedtobesearched, stringneedtobereplaced)

No comments:

Post a Comment