troubleshooting Question

Upadte SQL table based on records in another table

Avatar of SweetingA
SweetingA asked on
Microsoft SQL Server 2008
40 Comments1 Solution255 ViewsLast Modified:
In SQL server 2008 express.

I need to lookup each instance of startdate from tbl1 in tbl2 and insert the downtime code from tabl1 into tbl2 only where the downtime in tbl2 is not null.

tbl_1

ID     StartDate      StopDate       StopTime    DowntimeCode

1       2014-01-01   2014-01-02         24                     3
2       2014-01-02   2014-01-03         31                     6
3


tbl_2

ID     StartDate      StopDate       StopTime    DowntimeCode
         2014-01-01                                                          3
         2014-01-01                                                          3
         2014-01-02                                                          6

Thankyou very much for your assistance.
ASKER CERTIFIED SOLUTION
David Todd
Senior Database Administrator

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 40 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 40 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros