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
 SQL Update

Author  Topic 

jsn
Starting Member

1 Post

Posted - 2009-01-06 : 05:12:22
Plz tel me the query how to update more than 1 table at a time using single sql query

raky
Aged Yak Warrior

767 Posts

Posted - 2009-01-06 : 05:18:10
No you cant update more than one table in a single query. You have to use separate update stmts for each table
Go to Top of Page

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2009-01-06 : 05:20:29
quote:
Originally posted by raky

No you cant update more than one table in a single query. You have to use separate update stmts for each table



Unless you are updating the table through a view.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-06 : 08:28:22
http://weblogs.sqlteam.com/brettk/archive/2008/04/03/60560.aspx
Go to Top of Page

Zul
Starting Member

17 Posts

Posted - 2009-05-29 : 02:31:14
how can update table through a view, but in my problem is the table is diferent db with the view??
Go to Top of Page

Zul
Starting Member

17 Posts

Posted - 2009-05-29 : 02:50:22
how can update table through a view, but in my problem is the table is diferent db with the view??
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-05-29 : 03:00:00
what sakets is referring to "update table through a view" is creating update trigger on the view and perform the update to the required tables in the update trigger.


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

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-29 : 14:13:30
quote:
Originally posted by Zul

how can update table through a view, but in my problem is the table is diferent db with the view??


see this. just use db..table_name to access the other db table

http://weblogs.sqlteam.com/brettk/archive/2008/04/03/60560.aspx
Go to Top of Page
   

- Advertisement -