Help and Support
 

powered byLive Search

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 ID:953119
Last Review:May 27, 2008
Revision:1.1
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.

Back to the top

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.

Back to the top

STATUS

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

Back to the top

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

Back to the top


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

Back to the top

Keywords: 
kbexpertiseadvanced kbtshoot kbprb KB953119

Back to the top

Article Translations

 

Related Support Centers

Other Support Options

  • Need More Help?
    Contact a Support professional by E-mail, Online or Phone.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.