sql - Duplicate column name... but only if database is case insensitive -


i'm trying query view on database has case sensitive collation linked server connection. else note view i'm trying query wrapper 3 indexed views.

the error i'm getting is:

duplicate column names not allowed in result sets obtained through openquery , openrowset. column name "extprice" duplicate.

in view have extprice extprice. when query view server directly, don't have issues... when try use query via linked server, above error.

  • is collation issue?
  • how use view via linked server , still have query understand view case sensitive?

i apologize in advance if stupid question.

yes, result of case-sensitive collation on server views located.

and it's why grouse having case-sensitive collations @ server level directly (instead of using collations @ column-level) pointed out here: http://www.sqlmag.com/blog/practical-sql-server-45/tsql/collation-sql-server-139576

only, in trying wrap brain around how you'd cram collate clause distributed query, figured there had better way.

and, looks can set specific options part of linked server's definition: http://msdn.microsoft.com/en-us/library/ms191145.aspx defines how specify collation options when working collations in distributed queries.

the issue, however, you'll need use linked server instead of allowing ad-hoc distributed queries (but they're security risk/concern anyhow). i'd recommend using linked server better approach anyhow.

try link - provides details on how control collation settings on linked server: http://msdn.microsoft.com/en-us/library/ms186839.aspx

and, of course, i'd recommend changing column name if @ possible.

--mike


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -