读书人

面试题目。非常紧急多谢。

发布时间: 2012-03-14 12:01:12 作者: rapoo

面试题目。。。非常紧急。。。在线等。谢谢。。。。
Consider the following transaction code:

Begin Transaction
Update names_table set employee_name = "Ramesh " where employee_name = "Mahesh "
Save Transaction SAVE_POINT
Update salaries set salary=salary + 900 where employee_job = "Engineer "
Rollback transaction
Commit transaction
What will be the result produced by this transaction?
1. ?Ramesh? will be updated to ?Mahesh?, but salaries of engineers will not be
updated
2. Neither ?Ramesh? will be updated to ?Mahesh?, nor the salary of engineers will be updated.
3. ?Ramesh? will be updated to ?Mahesh? and salary of engineers will also be
updated


选哪个?谢谢!

[解决办法]
先翻译翻译
[解决办法]
两个UPDATE操作都会回滚
[解决办法]
1--2
2--2
[解决办法]
在我看来..上面没有正确答案
原因如下:
1.SQL里面的字符串不能用 " " 表示,因改为 ' '
2.第二句的查询条件是用 = 而字符串里面使用了 % MS不太妥吧.因该是没有结果可以显出来的

读书人网 >SQL Server

热点推荐