Tuesday, February 25, 2014

SQL - கேள்வி பதில் பகுதி - 6

Q 51. Explain why you might want to use a temporary table.

A. Temporary tables enable you to perform operations on data as if that data were structured differently than it actually is. For example, using temporary tables, you can join two tables, have the result go to a temporary table, sort the results, and then send the results back to SQL Server. The temporary table is in memory only, so its structure does not have to be stored anywhere.

Q 51. Explain why error handling is useful.

A. Without error handling, you get the default error handling associated with Visual Basic .NET. This default error handling is probably not what you want. Using custom error handling you can control exactly what happens when an error occurs.

Q 52. Give an example of where transaction processing may be useful.

A. Transaction processing would be helpful, for example, for an airline ticket processing system. If processing is interrupted during the booking of a flight, you would not want a partial transaction to be entered into the system. Using transaction processing, you ensure that the entire transaction is completed or the processing that has occurred is rolled back.

Q 53. Discuss the process of building and executing a C# stored procedure.

A. You must first write the stored procedure in the C# language within a Visual Studio 2005 class. You then build the project. You must then declare the stored procedure within SQL Server Management Studio Express. Finally, you can execute it just as you would any other stored procedure.

Q 54. Explain what the keyword Switch does.

A. The keyword Switch enables you to evaluate a variable and test its value against several conditions, executing the appropriate code based on the satisfied condition.

Q 55. Describe the purpose of input parameters.

A. Input parameters enable you to supply information to a stored procedure.

Q 56. Explain why you might want to use a temporary table.

A. Temporary tables enable you to perform operations on data as if that data were structured differently than it actually is. For example, using temporary tables, you can join two tables, have the result go to a temporary table, sort the results, and then send the results back to SQL Server. The temporary table is in memory only,  so its structure does not have to be stored anywhere.

Q 57. Explain why error handling is useful.

A. Without error handling, you get the default error handling associated with C#. This default error handling is probably not what you want. With custom error handling you can control exactly what happens when an error occurs.

Q 58. Give an example of where transaction processing may be useful.

A. Transaction processing would be helpful, for example, for an airline ticket processing system. If processing is interrupted during the booking of a flight, you would not want a partial transaction to be entered into the system. Using transaction processing, you ensure that the entire transaction is completed or the processing that has occurred is rolled back.

Q 59. Explain the difference between a breakpoint and a watch.

A. A breakpoint is an unconditional point at which you want to suspend code execution, whereas a watch is a condition under which you want to suspend code execution.

Q 60. Explain the difference between Step Into, Step Over, and Step Out.

A. Step Into executes code one line at a time. You use Step Over to execute a subroutine or function without stepping through its code. Finally, you use Step Out to execute the remainder of a subroutine or function without stepping through its code. You return to the procedure that called the subroutine or function in which you were.

No comments:

Post a Comment