I have a query that runs as part of a tool I work on. It has been running fine for ages, but recently (not sure exactly when but it is probably in the past week) is now failing with a syntax error.
The query is:
SELECT sys.fn_PhysLocFormatter(%%physloc%%) FROM dbo.Categories
and the error is:
Any ideas why this is giving a syntax error, when my colleagues don't have this issue when running the same query, some of whom are using the same version of SQL Server?
The server it is running against is SQL Server 2019 Developer Edition. It was the RTM, but in trying to resolve this error I've now updated it to the latest CU32. The error still happens. I've tried it on the same version of SQL Server in a container and it doesn't error.
It's not the same instance or account, but the account is an admin user in both. What's more confusing is that it was working on my machine a few weeks back and now doesn't.
Running:
SELECT @@VERSION;
SELECT [compatibility_level]
FROM sys.databases WHERE database_id = DB_ID();
SELECT [object_id], [type_desc]
FROM sys.all_objects
WHERE [object_id] = OBJECT_ID(N'sys.fn_PhysLocFormatter');
On the server where it's not working, the output is:
On a server where it is working, the output is:
I don't have another SQL 2019 server to hand other than in a container, so I'm aware that one is Windows and one is Linux.





