How to update two tables in one statement in SQL Server 2005

0 votes

In one operation, I want to update two tables. What is the procedure in SQL Server 2005?

UPDATE 
  Table1, 
  Table2
SET 
  Table1.LastName='DR. XXXXXX', 
  Table2.WAprrs='start,stop'
FROM 
  Table1 T1, 
  Table2 T2
WHERE 
  T1.id = T2.id
AND 
  T1.id = '010008'

Can someone please help me with this?

Aug 20, 2022 in Database by Kithuzzz
• 38,010 points
460 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

I want to use CASE statement to update some records in sql server 2005

UPDATE dbo.TestStudents SET LASTNAME = ( ...READ MORE

Sep 2, 2022 in Database by Kithuzzz
• 38,010 points
1,051 views
0 votes
1 answer

How to upsert (update or insert) in SQL Server 2005

Try to check for existence: IF NOT EXISTS ...READ MORE

answered Sep 18, 2022 in Database by narikkadan
• 63,420 points
467 views
0 votes
0 answers

How to update Identity Column in SQL Server?

With 200 records currently, I want to ...READ MORE

Aug 9, 2022 in Database by Kithuzzz
• 38,010 points
1,094 views
0 votes
0 answers

How to Create a real one-to-one relationship in SQL Server?

I have two tables, Country and Capital, ...READ MORE

Aug 18, 2022 in Database by Kithuzzz
• 38,010 points
320 views
0 votes
0 answers

How to find sum of multiple columns in a table in SQL Server 2005?

I have a table Emp which has these rows: Emp_cd ...READ MORE

Aug 19, 2022 in Database by Kithuzzz
• 38,010 points
1,357 views
0 votes
0 answers

How to display two digits after decimal point in SQL Server?

I want to return the value of ...READ MORE

Aug 26, 2022 in Database by Kithuzzz
• 38,010 points
909 views
0 votes
0 answers

Selecting COUNT(*) with DISTINCT

In SQL Server 2005, I have a ...READ MORE

Feb 14, 2022 in Database by Neha
• 9,060 points
313 views
0 votes
0 answers

Simple DateTime sql query

How do I query the DateTime database ...READ MORE

Aug 12, 2022 in Database by Kithuzzz
• 38,010 points
429 views
0 votes
0 answers

What represents a double in sql server?

I have several properties in C# which ...READ MORE

Aug 13, 2022 in Database by Kithuzzz
• 38,010 points
558 views
0 votes
0 answers

Convert Month Number to Month Name Function in SQL

I have the months 1, 2, 3, ...READ MORE

Sep 4, 2022 in Database by Kithuzzz
• 38,010 points
1,657 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP