Here's a modified example of a query I found under 'Recent Expensive Queries' in SQL Server Management Studio:
SELECT "Col1856", "Col1857", "Col1858", "Expr1041"
FROM
(SELECT "Col1856", "Col1857", CONVERT(nvarchar(50), "Col1862",0) "Expr1041"
FROM
(SELECT "Tbl1010"."user_id" "Col1848", "Tbl1010"."first_name" "Col1849", "Tbl1010"."last_name" "Col1850"
FROM "Web"."dbo"."users" "Tbl1010") Qry1854,
(SELECT "Tbl1004"."cart_id" "Col1856", "Col1863", "Tbl1004"."date_stamp" "Col1859", "Tbl1004"."isQuote" "Col1871", "Tbl1004"."isSavedForLater" "Col1872", "Tbl1008"."accountNum" "Col1878", "Tbl1008"."s_id" "Col1876"
FROM "MyDB"."dbo"."orders" "Tbl1004", "Web"."dbo"."sites" "Tbl1008"
WHERE CONVERT(nvarchar(50), "Tbl1004"."code",0) = "Tbl1008"."code") Qry1880
WHERE "Col1857" = "Col1848") Qry1881
ORDER BY
"Col1879" ASC, "Expr1041" ASC
The actual syntax doesn't matter but I'm having trouble tracking where this query is actually running due to taking a lot of resources.
What's the reason for it looking like this instead of just using the column/table names themselves?