Build warning SQL71558 (differs only by case) for Synonyms (not same name)
- Dominant language
- C#
- Stars
- 460
- Forks
- 29
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 7
Description
- SqlPackage or DacFx Version: 170.4.53.0 & 170.4.83.3
- .NET Framework (Windows-only) or .NET Core:
- Environment (local platform and source/target platforms): VS 2026 18.8.0 & SSMS 22.8.0 on Windows 22H2 19045.6456
**Steps to Reproduce:**
1. CREATE TABLE [dbo].[Table] ([ID] Int CONSTRAINT [PK_Table] PRIMARY KEY)
2. CREATE SYNONYM [dbo].[Switch] FOR [dbo].[Table]
3. CREATE PROCEDURE [dbo].[spGet] AS SELECT ID FROM dbo.Switch;
...\dbo\Procedures\spGet.sql(1,1): **Warning: SQL71558: The object reference** [dbo].[Switch].[ID] **differs only by case from the object definition** [dbo].[Table].[ID].
If a different scheme but the same name of objects - the warning does not arise.
CREATE SYNONYM [MySchema].[Table] FOR [dbo].[Table]
CREATE PROCEDURE [MySchema].[spGet] AS SELECT ID FROM MySchema.[Table]
-- No warnings
**Did this occur in prior versions? If not - which version(s) did it work in?**
It's a very old problem.
(DacFx/SqlPackage/SSMS/Visual Studio/Azure Data Studio)
The problem is that in the production environment in complex scenarios, you need to control the purity of the code (especially when the base with the *_CS_AS directives) and synonyms are used in many places.
Hanging "Suppress TSql Warnings" is not a solution, and it's hard to exclude these Warnings so you wouldn't miss other Warnings.
Contributor guide
Assessment
This issue has not been assessed yet.