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 in Database by Kithuzzz
• 11,640 points
26 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 in Database by Kithuzzz
• 11,640 points
32 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 in Database by narikkadan
• 19,680 points
19 views
0 votes
0 answers

How to update Identity Column in SQL Server?

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

Aug 9 in Database by Kithuzzz
• 11,640 points
159 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 in Database by Kithuzzz
• 11,640 points
21 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 in Database by Kithuzzz
• 11,640 points
89 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 in Database by Kithuzzz
• 11,640 points
32 views
0 votes
0 answers

Selecting COUNT(*) with DISTINCT

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

Feb 14 in Database by Neha
• 8,920 points
105 views
0 votes
0 answers

Simple DateTime sql query

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

Aug 12 in Database by Kithuzzz
• 11,640 points
22 views
0 votes
0 answers

What represents a double in sql server?

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

Aug 13 in Database by Kithuzzz
• 11,640 points
25 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 in Database by Kithuzzz
• 11,640 points
11 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP