Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL - How to alter collation on an existing view

I have an existing view. I need to change the collation on one of the columns in the view. How can I achieve this using T-SQL? Thanks in advance.

like image 356
Coloplast Avatar asked Oct 30 '22 20:10

Coloplast


1 Answers

Something like this:

Alter View YourViewName
AS
Select Yourcolumn Whatever_collation_you_need
from YourTable 

Also, if you need to link your view with another table or view, you could just specify the collation like this, with no need to alter your view:

select
*
from v_Filiales f --> this is a view
inner join t_Persona p --> this is a table
on p.cPerCodigo = f.cPerJuridica COLLATE Latin1_General_CI_AS
like image 139
MRamL Avatar answered Nov 15 '22 13:11

MRamL