Reputation: 627
I am updating one column in a table from details view control of .net 3.5 and using SQL Server 2005
The problem is I have to update same column in 5 more tables in the same database but have to use single database
Is it possible?
please let me know the SQL query syntax form update if possible.
Upvotes: 0
Views: 193
Reputation: 3793
There are work arounds.
create a view such that it has 5 table joins and a select statement on 5 columns. Then update the view.
Write update trigger on table 1 and in the trigger write update for table2...continue.
I have not tried this before, so just first give a try.
Upvotes: 1
Reputation: 204924
You can't update 5 different tables in one update query.
You can write a stored procedure that updates that 5 tables and call that procedure once.
Upvotes: 4