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 2005 Forums
 Transact-SQL (2005)
 execute multiple updates within a SP

Author  Topic 

cplusplus
Aged Yak Warrior

567 Posts

Posted - 2010-08-31 : 10:17:44
I am planning on executing multiple update statements with in a stored proc.

do i need to put anything like "GO" between each update statement or can i just execute one by one.


Update t1 set t1.revid=t2.revid, t1.revno=t2.revno from #TEMPFINDOCR1 t1
Inner join TAB_ccsNetDMRevision t2 on (t1.type_id = t2.dmid and t1.docid=t2.documentid)


Update t1 set t1.progid= t2.progid, t1.projid=t2.projid,t1.contractid=t2.contractid,t1.dmtypeid=t2.dmtypeid, t1.dmno=t2.dmno from #TEMPFINDOCR1 t1
Inner join TAB_ccsNetDM t2 on (t1.type_id = t2.dmid)

Thank you for the helpful info.

kunal.mehta
Yak Posting Veteran

83 Posts

Posted - 2010-08-31 : 10:19:35
I dont think so.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-08-31 : 10:27:22
You dont need to use GO statement. Just specify them one by one

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -