T-SQL Queries: UPDATE one table with data from another table

20160618 UPDATE one table with data from another table

This is something you would never want to do with these two tables in real life, but I wanted to try out the functionality so that tomorrow I could go up to work and try it on a temp table as part of a project we are currently working on.

I also want to try this with a

WHERE Sales.SalesPerson.BusinessEntityID = Sales.SalesPersonQuotaHistory.BusinessEntityID

instead of the “FROM” clause – though if this has a chance of working, I need to update the set line to:

SET Sales.SalesPerson.Bonus = Sales.SalesPersonQuotaHistory.Bonus

I guess we shall see. 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s