Advertisement

04.16.2008 at 03:48PM PDT, ID: 23329204
[x]
Attachment Details

How do I create update statement that checks a field in related table, and sets to that value if it is different?

Asked by ParallelFifth in MS SQL Server, Databases Miscellaneous, SQL Query Syntax

Tags: SQL

SQL 2005:
Problem:
I have a table of Items (Items) that has FK in table of order items (orderItems).  Both of these tables have a unitPrice field.  I need to update the orderItems - unitPrice if it is different from the Items - unitPrice.  It needs to be set to the value in the Items - unitPrice field only if they are different.

Thanks in advance!Start Free Trial
[+][-]04.16.2008 at 04:23PM PDT, ID: 21372852

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS SQL Server, Databases Miscellaneous, SQL Query Syntax
Tags: SQL
Sign Up Now!
Solution Provided By: BriCrowe
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628