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)
 i need little help with update

Author  Topic 

marconi8
Yak Posting Veteran

73 Posts

Posted - 2003-05-06 : 06:49:34
if any of us have a little free time then can you help me with this very basci simple thing

i have two updates, i'am trying to make from two update one update, cannot find out with this

there are my two updates

 

UPDATE b
SET b.ACCESS=1
FROM DOSKA_PODGRUPA b
WHERE ID IN (
SELECT ID
FROM DOSKA_OBIAVLENIA
WHERE VISH_GRUPA_ID=@GRUPA_ID
AND
VISH_PODGRUPA_ID!=@PODGRUPA_ID
)







 

UPDATE a
SET a.GRUPA_ID=a.VISH_GRUPA_ID,
a.PODGRUPA_ID=a.VISH_PODGRUPA_ID,
a.VISH_GRUPA_ID=NULL,
a.VISH_PODGRUPA_ID=NULL

FROM DOSKA_OBIAVLENIA a
WHERE a.ID IN (
SELECT ID
FROM DOSKA_OBIAVLENIA
WHERE VISH_GRUPA_ID=@GRUPA_ID
AND
VISH_PODGRUPA_ID!=@PODGRUPA_ID
)








thanks for help !

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2003-05-06 : 07:13:44
An update statement can on effect one table. There is not way to make these two updates into one update because each one effects a different table.

Jay White
{0}
Go to Top of Page
   

- Advertisement -