Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

Join with constant

Joins in non-ANSI format should be upgraded to ANSI format.

Microsoft SQL Server 2000

SELECTFROM <table_name1>,<table_name2> 
WHERE <column_table1>*=<column_table2> AND <column_table2>=<constant>

Microsoft SQL Server 2008

SELECTFROM <table_name1> 
LEFT OUTER JOIN <table_name2> 
ON <column_table1>=<column_table2> AND <column_table2>=<constant>  
WHERE

Example: Microsoft SQL Server 2000:

SELECT shop_name 
FROM shop, customer 
WHERE shop.good_id*=customer.good_id AND customer.price=123 AND shop.good= “Milk”

Microsoft SQL Server 2008:

SELECT shop_name 
FROM shop 
LEFT OUTER JOIN customer ON shop.good_id=customer.good_id AND customer.price=123  
WHERE  shop.good= “Milk”

Ispirer Home Page Ispirer SQLWays Product Page - Migration to SQL Server Request SQLWays

sqlways/sql-server/upgrade/statementssyntax/joins-old-format/joinconstant.txt · Last modified: May 07, 2018, 03:15:34 PM (external edit)
 
© 1999-2020, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement