2
请看下面的代码,更新如何处理唯一值?
Create table #test
(
id int primary key,
Name varchar(100)
)
insert into #test values (1,'John')
insert into #test values (2,'Walker')
insert into #test values (3,'Bob')
insert into #test values (4,'Tailor')
insert into #test values (5,'Phlip')
insert into #test values (6,'Kevin')
-- Query 1 :
update #test set name = 'Joney' where id = 1
-- Query 2 :
set rowcount 1
update #test set name = 'Joney' where id = 1
set rowcount 0
- #TEST表具有主键&聚簇索引。
- 很明显,只有一行可用于id。
- 在查询1中,即使找到1行,sql server是否会查找匹配的行?
- 查询2真的会获得一些性能吗?
在此先感谢