The /strict option appears to be broken.
I have a script to create a database. I run this script on a instance running SQL 2022, and then I modify the script to create a second database on the same instance. Then I run:
"C:\Program Files\Microsoft SQL Server\160\COM\tablediff.exe" /strict -sourceserver .\TJUTVÅ -sourcedatabase NorthDynamic2 -sourcetable Orders -destinationserver .\TJUTVÅ -destinationdatabase NorthDynamic -destinationtable Orders
And I am told that
Table [NorthDynamic2].[dbo].[Orders] on .\TJUTVÅ and Table [NorthDynamic].[dbo].[Orders] on .\TJUTVÅ have different schemas and cannot be compared.
Using Profiler, I can see that tablediff submits:
SET FMTONLY OFF; SET NO_BROWSETABLE ON; SET FMTONLY ON;SELECT * FROM [dbo].[Orders] WITH (READUNCOMMITTED) WHERE 1=2 SET FMTONLY OFF; SET NO_BROWSETABLE OFF;
It uses SET FMTONLY ON to deduce the schema - but there are better methods to do this. But even then, it should get the same result - but maybe SQL Server is pulling its legs.