Using sqlcmd with FOR XML returns Invalid Object name 'dbo.Table' yet Query runs in SSMS
问题 This is my query: SELECT title1, [precinct percent] AS [PrecinctPercent], leader, [leader percent] AS [LeaderPercent], Winner, WinningVotes, leader2, [leader2 percent] AS [Leader2Percent], Loser, LosingVotes FROM [leader].dbo.[RACE] r inner join (select rc.[race number], max(case when seqnum = 1 then [candidate num] end) as Winner, max(case when seqnum = 1 then Votes end) as WinningVotes, max(case when seqnum = 2 then [candidate num] end) as Loser, max(case when seqnum = 2 then Votes end) as