January 4, 2018 at 1:36 am
Hi there
Is there a way of changing the collation for a view, and not by individual columns in a view?
ie. SELECT * FROM vwName COLLATION...
January 4, 2018 at 2:22 am
Hi,
No you cannot use collate in select from view. you can change collation in body of your view .
January 4, 2018 at 5:56 pm
Thanks for the reply.
Can this be done for a whole table within a view then, say:
SELECT ... FROM table <COLLATION>
or does it have to be done by individual column within the view?
January 4, 2018 at 6:16 pm
shindle 17293 - Thursday, January 4, 2018 5:56 PMThanks for the reply.Can this be done for a whole table within a view then, say:
SELECT ... FROM table <COLLATION>
or does it have to be done by individual column within the view?
Cant be done for a whole table in this way. Per BOL:
"[SQL Server COLLATE] is a clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast."
You will have to change the underlying table definition or apply the desired collation to the column references in your view. Heres a good article on this topic:
https://www.red-gate.com/simple-talk/sql/sql-development/questions-sql-server-collations-shy-ask/
-- Itzik Ben-Gan 2001
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply