collation - SQL Server collate error between 2 databases -


i have had take existing stored procedure , amend 1 of tables comes different database. databases have been set different collate sequences.

here's code far:

alter procedure [dbo].[usp_getcontactdetails]                 @smid varchar(100) = ''                             begin               set nocount on;          select distinct          a.staffid staffid, a.firstname firstname,          a.surname surname, a.firstname + ' ' + a.surname staffname,                 a.jobtitle [job title],         d.dept [dept], a.location [location], a.locationid [locationid],         isnull(b.mobile, '') [mobile],                 isnull(b.directfaxno, '') directfaxno,             cast(isnull(sp.[profile_description], '') varchar(8000)) [profile],                   directtel = isnull((select top 1 sitetelephone                              [directory].dbo.location o                              o.siteid = sit.siteid), ''),         officefax = isnull((select top 1 sitefax                              [directory].dbo.location o                              o.siteid = sit.siteid), ''),         isnull(a.emailaddress,'') email,                 c.designation designation,  jobid = ' '               #contacts      contact_details c  left join     [directory].dbo.extradetails b on c.staffid collate sql_latin1_general_cp1_ci_as = b.staffid,                 (select           s.locationid , s.staffid,                    dbo.fun_getofficeid(s.locationid) officeid                             [directory].dbo.vwstaff s) officetable,               [directory].dbo.vwstaff          left outer join     [directory].dbo.sitelocation sit on a.locationid collate    sql_latin1_general_cp1_ci_as = sit.locationid          left outer join     dbo.staff_profile sp on a.staffid collate sql_latin1_general_cp1_ci_as = sp.staff_id left outer join     [directory].dbo.department d on a.deptid collate sql_latin1_general_cp1_ci_as = d.deptid      officetable.staffid = a.staffid                 , a.staffid = c.staffid                    ,  

i keep getting following error, don't know else needs collate statement.

msg 468, level 16, state 9, line 1
cannot resolve collation conflict between "sql_latin1_general_cp1_ci_as" , "latin1_general_ci_as" in equal operation.


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -