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
 General SQL Server Forums
 New to SQL Server Programming
 update multiple col to multiple table

Author  Topic 

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2009-09-07 : 02:46:12
dear user

its posible to update query to upldate a multiple colomn of multiple table in one update statement.


thanks in advance

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-09-07 : 02:51:34
there is any common column between the table then u can update in a single update statement...
Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-07 : 03:54:59
You cannot update more than one table at a time.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-09-07 : 04:04:43
any particular reason you need to do this ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

amirs
Constraint Violating Yak Guru

260 Posts

Posted - 2009-09-07 : 07:17:05
thanks to all to replay
my req. is following my sample table.

tab1
empid name addres
1 a add-a
2 b add-b
3 c add-c
tab2
salid empid salary
1 1 1000
2 2 2000
3 3 3000

tab3
deptid empid depnm
1 1 comp
2 2 mkt
3 3 fin

their is one common colom is emp id
i will update two colom of salary in tab2 and depnm in tabl3 for emp in one update query .
so how i can write this query.

thanks


Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2009-09-07 : 07:20:25
quote:
Originally posted by webfred

You cannot update more than one table at a time / in one statement.


No, you're never too old to Yak'n'Roll if you're too young to die.




No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page
   

- Advertisement -