Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 update performance

Author  Topic 

cbeganesh
Posting Yak Master

105 Posts

Posted - 2009-04-21 : 12:38:37
i wanted to know whether having index on the table will imrpove the performance on update statement.

Table A has last name, first name and table B has Name column

i want to mark tableA where ever there is match on name

for example
update tableA
set mark = 1
from tableA A, tableB B
where a.lastname = b.name

if we have index on lastname in tableA, can the performance be improved or it wont have any effect

nr
SQLTeam MVY

12543 Posts

Posted - 2009-04-21 : 12:44:38
It would probably help. Try it and look at the query plan to see if it's used.

Might want to
and A.mark <> 1
if some are already 1. Would want to include mark in the index if this is the case probably.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -