Report Bug in Sql Server Query Builder (SSMS) Version 18.12.1

shahab biabani 41 Reputation points
2022-09-12T09:50:42.677+00:00

I will try to explain the problem thoroughly

Consider two tables that are related

CREATE TABLE [dbo].Table_1 ON [PRIMARY]
GO
/****** Object: Table [dbo].[Table_2] Script Date: 9/12/2022 2:12:36 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].Table_2 ON [PRIMARY]
GO
ALTER TABLE [dbo].[Table_2] WITH CHECK ADD CONSTRAINT [FK_Table_2_Table_2] FOREIGN KEY([Table1_ID])
REFERENCES [dbo].[Table_1] ([ID])
GO
ALTER TABLE [dbo].[Table_2] CHECK CONSTRAINT [FK_Table_2_Table_2]
GO

240054-imga.png

As you can see, this relationship is established !

In the SSMS SQL Query Builder section I select two tables

240045-imgb.png

But it shows the relationship between these two tables incorrectly

As you can see, it returns wrong relationships

false:
SELECT *
FROM Table_1 INNER JOIN
Table_2 ON Table_1.ID = Table_2.ID

true:
SELECT
*
FROM dbo.Table_2
INNER JOIN dbo.Table_1
ON Table_2.Table1_ID = Table_1.ID

SQL Server | Other
{count} votes

Answer accepted by question author
  1. YufeiShao-msft 7,151 Reputation points
    2022-09-13T08:49:12.68+00:00

    Hi @shahab biabani ,

    This is Microsoft SQL Server developers monitoring the feedback system, you can report the issue you find here:
    https://feedback.azure.com/d365community/forum/04fe6ee0-3b25-ec11-b6e6-000d3a4f0da0

    I try your operation, but it did not reach your steps, I suspect that the error may be caused by the different versions

    -------------

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.