sql server 2005 - Using FOR XML AUTO against a synonym -


We switched to the synonyms for the linked server stuff, and it has been found that our XML output is no longer correct is. When returning XML results from one view, we can nick the view and this element will be designated as the name. With synonyms, however, it seems to neglect the nickname? We are still mostly on SQL 2005 - this bug does not appear on our 2008 example. Is this a known problem, and any ideas for work around?

For example, this was what we were able to do:

Select the top 3 numbers from number as the element name for XML Auto; & Lt; Elementname number = "0" /> gt; & Lt; Elementname number = "1" /> gt; & Lt; Elementname number = "2" />

And it happens with one of the options:

  number as elementname for XML auto_ Select the top 3 numbers from the Sinemine < Dbo Number number = "0" /> & lt. Dbo.Numbers number = "1" /> & lt; Dbo Number number = "2" />  

As you can see, SQL Server uses the names of actual referenced objects instead of aliases. This cross-server becomes even worse for queries, because you get the name of the four-part instead of the good nickname. (Example: & lt; rick_server.rick_database.dbo.Numbers number = "0" /> ...)

"item" = "text">

Sometimes "code" for XML auto - If you use more than the verbose, you control the name of the XML element. Can: Select number 3 from numbers for

  XML PATH ('elementname'), TYPE  

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -