A CROSS JOIN clause is automatically inserted into an UPDATE statement that uses an INNER JOIN clause when you execute the statement in the SQL pane of SQL Server Management Studio

Article translations Article translations
Article ID: 953119 - View products that this article applies to.
Expand all | Collapse all

On This Page

SYMPTOMS

In Microsoft SQL Server 2005, you have an UPDATE statement that uses an INNER JOIN clause. When you execute the statement in the SQL pane of SQL Server Management Studio, a CROSS JOIN clause is automatically inserted into the UPDATE statement.

WORKAROUND

To work around this problem, execute the statement in a query window in SQL Server Management Studio.

To open a query window, click New Query in SQL Server Management Studio.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the problem

  1. Start SQL Server 2005 Management Studio.
  2. Click New Query to open a query window, and then execute the following statement:
    CREATE DATABASE MyDB
    GO
    
    USE MyDB
    GO
    
    CREATE TABLE Table1 (Col1 int, Col2 nchar(10))
    GO
    
    CREATE TABLE Table2 (Col1 int, Col2 nchar(10))
    GO
    
    INSERT INTO Table1 VALUES (1, ‘Value1’)
    GO
  3. In Object Explorer, expand Databases, expand MyDB, expand Tables, right-click the Table1 table, and then click Open Table.
  4. On the Query Designer menu, point to Pane, and then click SQL.
  5. In the SQL pane, execute the following statement:
    UPDATE Table1
    SET Col2 = 'AAA'
    FROM Table1 INNER JOIN Table2 on Table1.Col1 = Table2.Col1

Properties

Article ID: 953119 - Last Review: May 27, 2008 - Revision: 1.1
APPLIES TO
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
Keywords: 
kbexpertiseadvanced kbtshoot kbprb KB953119

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com