I have a website and related database in English version, now I am trying to start with other language, such as Chinese.
The first problem I am facing is: search a user name when user name is Chinese:
For example: English version: SELECT u_name FROM Users WHERE u_name = 'eric', it will return a value, but if I type: SELECT u_name FROM Users WHERE u_name = '艾瑞克', even if the table cell has the 艾瑞克 record, it won't return anything.
Search online, there are a lot of articles, since I am pretty new for this, can you let me know where to start? How to change the collation for the existing db, do I need to create stored procedure for the search?
I would like to solve this problem start from my MSsql 2005 database. If that works fine, then I will go to my web application.
I've restored a SQL Server 2000 database with a Latin1_General_BIN collation from a .dmp file to a SQL Server 2005 server with a default collation of SQL_Latin1_General_CP1_CI_AS. When I try to change the database collation I get hundreds of the following error:
The object 'CK_PM10200_GLPOSTD_00AF8CF' is dependent on database collation. So, in this case, is it even possible to change the collation if there are objects in the database that are dependent on it?
I am using SQL Server 2008. In ServerProperty function, there are two properties called “Collation” and “CollationID”. In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
I am using SQL Server 2008. In ServerProperty function, there are two properties called “Collation” and “CollationID”. In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
I am using SQL Server 2008. In ServerProperty function, there are two properties called "Collation" and "CollationID". In some cases, I will only know the CollationID. Is it possible get the collation name from the CollationID? Is there a function called CollationNameFromID?
dear experts while i'm learning BCP from books online, i got a doubt. copying data between different collations. what exactly the meaning of collation?
i tried in BOL. but because i'm a junior, i didnt got the good idea about collation. please explain me
I am just trying to understand about how collation and unicode work in SQL Server. My database's collation is Latin1_General, and I set one column in one table to have collation Cyrillic_General. Then in Windows PC where I am running an application that is connected to my database, I set Mongolian Language from Regional Settings. When I typed using Mongolian Keyboards and save the characters into database, then I can retrieve the cyrillic characters back into my application. However, when I checked into database using Query Analyzer, those characters are saved in the column, that has collation Cyrillic_General and with nchar data type, apparently using codepage 1252, my database default codepage. My application and my database server are located in two different machines and I don't install Mongolian language in my database server. So that when other web application reads those characters from that column, even my browser has been set to use Cyrillic encoding, still it showed as characters from codepage 1252.
Could someone explain me what actually happens here?
Hello AllI'm a bit confused about collation settings so needed some info. onit. My database server is currently using SortOrder asLatin1-General, case-insensitive, accent-sensitive,kanatype-insensitive, width-insensitive for Unicode Data, SQL ServerSort Order 52 on Code Page 1252 for non-Unicode DataI have a table:CREATE TABLE [PD_RUSS3].[pdtable_185]([iso_area_indx_no] [int] NULL ,[lineid_1] [varchar] (16) COLLATE SQL_Latin1_General_CP1_CS_AS NULL ,[iso_type] [smallint] NULL) ON [PRIMARY]I have a nonclustered, UNIQUE index located on PRIMARY oniso_area_indx_no, lineid_1, iso_typeHowever I'm able to load a file with these entries:45 '16-XX-WCS' 145 '16-xx-WCS' 1I thought that this would fail because of the above settings. Pleaseenlighten me on what I'm missing here..??thanksSunitJoin Bytes!
Hi,I have SQL Server 2005 database with SQL_Latin1_General_CP1_CI_AS collation, and there is a little problem when inserting Cyrillic text. It works fine when I use SQL Server Management Studio to open specific table and insert new row manually. Problem appears when I use SQL queries. For example: INSERT INTO Customer (ID, Name) VALUES (1, "Владимир"). ID is type of int, and Name is nvarchar.When I execute the query, value of ID is OK (it is 1), but insted of "Владимир" the value of Name is "????????" (only question marks).I am not sure now, if I should change database collation(and what to put), or I should change column type of "Name" column.
why do i get collation conflict when i used temp table ??Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.i solved it by using COLLATE Latin1_General_CI_AS (the column name)will i have collation conflicts again when i put my web app on a web hosting company??
Which collation format should I use? SQL_Latin1_General_CI_AS, SQL_Latin1_General_CP1_CI_AS, or Latin1_General_CI_AS I noticed that my development server has a different collation setting to the production server. development. SQL_Latin1_General_CP1_CI_ASproduction. Latin1_General_CI_AS Both these servers are SQL Server 2005 Express and I typically use varchar or text fields for storing the data. I've been told that the difference between them is that the former uses code page 1252, as specified here: http://www.microsoft.com/globaldev/reference/sbcs/1252.mspx However when I compare that to, say, the page of symbols one gets using the 'Insert, Symbol' command via microsoft word I find quite a disagreement. It also differs from the 'View, Clip Library' list provided by TextPad. The data in my database uses non-ASCII characters (or extended ASCII, if you prefer). The administrators of my CMS will sometimes copy and paste or write European spellings for company names etc. When they do that they're likely to resort to Word's Insert Symbol command. When I get this data and show it on a web page I want to specify utf-8 endcoding. Which of these SQL server collations should I be using. I suspect that I should be using SQL_Latin1_General_CI_AS. Essentially, I want the charater as seen in the textbox of the CMS to look identical to that displayed on a web page which has the following meta tag set: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> The aforementioned CMS administrators are entering data on Windows XP PCs running asp.net. They may get the accented characters from several different sources (MS Word Insert Symbol or cut and paste from a web page), but they can agree with me that the symbol should display in the text box of the CMS identically to that on the web site. Can someone put me right on this?
what's the difference between SQL_Latin1_General_CP1_CI_AS and Latin1_General_CI_AI What the SQL and CP1 mean in SQL_Latin1_General_CP1_CI_AS?and which one should i use?
I have a database in SQL with the following collate name: SQL_Latin1_General_CP1_CI_AS... I am trying to change the accent sensetive to accent insensitive... how would I do this? I tried re-installing the SQL and setting the default to CI_AI, but since the database that is backed up uses CI_AS, the DB settings overrides the default settings...
I require the command syntax to return the collation properties for a database at table and column level in both SQL7 and in 2000 for an entire database. Hopefully for all tables and for all columns in the db. Does any one have the script for this command???? If you do let me know. Problem as below.
On one server (ServerA) a query works. 2000 server that may have been upgraded from versions 6.5 - 7.0 - 2000 Collation = SQL_Latin1_General_CP1_CI_AS, Sort order=52 On server B the query doesn't work but has same Collation = SQL_Latin1_General_CP1_CI_AS, Sort order=52. I restored the databases from Server A onto Server B and ran the same query and it fell over with this error message.
Server: Msg 451, Level 16, State 2, Procedure Bills, Line 3 Cannot resolve collation conflict for column 2 in CREATE VIEW statement. Server: Msg 4413, Level 16, State 1, Line 1 Could not use view or function 'Bills' because of binding errors.
Hello, dear Friends! My situation is a following: I have some not big databases with only English data and some conteining data in Hebrew. My question is: May I manage two collation types- meaning the database collation type will be for example some kind of Latin and some databases' collation will be in Hebrew. If you have any experience of managing DB's in two absolutely different languages (Japanesse, Russian, Chinesse, Arabic with English) please tell me about it. Best regards. Marina.:rolleyes:
Hi I have recently downloaded the most updated version of mysql, since then I get "latin1_swedish_ci" as the default collation. I had never noticed Collation before.
I use mysql for english language. Should I change the collation to another option? What option is the most broad one?
I am attempting to transfer data between two SQL Server 2000 DBs. The transfer fails and returns a message "Incorrect Syntax near 'Collate'". There is an option in the DTS Import/Export Wizard of Use Collation but this option is turned off. Is there any server specific configuration regarding collation I might turn off? Both databases reside on the same server and the Collation properties for both DB's are set the same. Please Help
New SQL2000 installation into which I've copied data from multiple SQL7 installations. Some of the databases I've copied over from a SQL7 server with code page 850, sort order/collation 42, using the detach-copy mdf/ldf-attach procedure outlined elsewhere on this site (thank you). Other databases have been DTS'd from another SQL7 server with code page 850, sort order/collation 44.
In the end I want all databases to be in the default Latin1_General_CI_AI collation I've chosen for my installation.
I'm off to immerse myself in collation papers and alter database documentation from BOL, but was hoping someone could enlighten me in a less painful way.
Our SQL servers have been setup to collate American. However, our pc's are setup for South Africa. This is creating a nightmare for us as we use Great Plains, which is an American product with American date format.
We are having difficulties in doing any development due to this issue.
Can someone please advise me as to whether there is another way around this ?
All my servers have a default collation of Latin1_General_CPI_CI_AS. Apart from one that is. It was rebuilt with the wrong collation of Latin1_General_CI_AS. This is causing problems with an application and the collation needs to be changed to be the same as all the other servers.
I know I could create scripts for all the objects, rebuild the master database, recreate the user databases and then create the objects and BCP all the data over, but this sounds a bit nasty.
Can anyone suggest a quicker and easier way to accomplish this?
thanks, Lesley
P.S. The server that was wrongly built was done so before I started this job, honest.
All my tables have the same collation, the groups default collation is the same as all the tables I have copied over but I still get the :
Server: Msg 446, Level 16, State 9, Procedure SP_TT_EnqSearchByPhoneV2, Line 27 Cannot resolve collation conflict for equal to operation.
error
The stored procedure is this: declare @enqid int, @count int ,@launchNextPage int
set @count = (select count(enqid) from TT_EnquiryTable where REPLACE(EnqPhone,' ','') = @phone) set @count = @count + (select count(enqid) from TT_ENquiryTable where REPLACE(EnqPhone,' ','') = @phone) IF NOT EXISTS(select * from TT_EnquiryTableLocal where enqphone = @phone)
BEGIN IF NOT EXISTS(select * from TT_EnquiryTable where REPLACE(enqphone,' ','') = @phone ) BEGIN insert into traveltime..TT_enquiryTableLocal(enqphone, opcomid) values (@phone, @opcomid) set @enqid = @@identity END ELSE BEGIN insert TT_EnquiryTableLocal(enqphone, opcomid) values(@phone, @opcomid)
set @enqid = @@identity update l set l.enqentrydate = getdate(),l.enqname= e.enqname, l.enqaddress = e.enqaddress, l.enqtown = e.enqtown,l.enqcounty = e.enqcounty, l.enqpostcode = e.enqpostcode, l.enqemail = e.enqemail, l.enqcomments = e.enqcomments, l.enqfutureaccept = e.enqfutureaccept, l.officeid = e.officeid,l.oldenqid = e.enqid from traveltime..TT_enquiryTableLocal l , internet..TT_enquiryTable e where REPLACE(e.enqphone,' ','') = @phone and l.enqphone = e.enqphone and l.enqid = @enqid
END END ELSE BEGIN
IF EXISTS (Select * from TT_enquirytableLocal where enqphone = @phone and sent >= 1 ) --and datediff(dy,enqentrydate,getdate()) >=1 ) AND NOT EXISTS (Select * from TT_enquirytableLocal where enqphone = @phone and sent = 0) --and datediff(dy,enqentrydate,getdate()) >=1 ) BEGIN INSERT TT_EnquiryTableLocal select TOP 1 '',getdate(),enqname,enqaddress,enqtown,enqcounty, enqpostcode,@phone,enqemail, enqcomments, enqfutureaccept,officeid, 0 /*sent*/,7,'',@opcomid from TT_EnquiryTableLocal where enqphone = @phone
set @enqid = @@identity set @count = 0 set @launchNextPage =0 END ELSE BEGIN
IF EXISTS(select top 1 * from TT_EnquiryTable e, TT_enquiryTable l where e.enqphone = @phone and l.enqphone = e.enqphone and (e.enqphone is not null and e.enqphone <> '')) BEGIN select top 1 @count as 'count',* from TT_EnquiryTable e, TT_enquiryTable l where e.enqphone = @phone and l.enqphone = e.enqphone and (e.enqphone is not null and e.enqphone <> '')
order by e.enqid desc
END END END IF @enqid >=1 BEGIN SELECT @count as 'count',@enqid as 'enqid', * FROM TT_EnquiryTableLocal where enqid = @enqid and sent =0 order by e.enqid desc END ELSE BEGIN SELECT TOP 1 @count as 'count',@enqid as 'enqid', * FROM TT_EnquiryTableLocal where enqphone = @phone and sent =0 order by e.enqid desc END
I have a db server which was installed with Collation 'SQL_Latin_General_CP1_CS_AS' and now I have to replace this server with a new server and I want to install this server with Collation 'SQL_Latin_General_CP1_CI_AS'.
I am using Linked Servers to collect some data from my Sybase database which has "Code Page 850 (Multilingual) character set,us_english,Binary ordering, for use with Code Page 850 (cp850)."
But with new SQL server(case-insensitive settings), I am unable to run a select query (joining a local server and sybase server) and I get an error message "cannot resolve collation conflict for equal to operation"
I have tried changing property of linked server by specifying Remote server collation to true and Collation Name as 'SQL_Latin_General_CP1_CS_AS' as well as 'SQL_Latin_General_CP850_Bin' but I do get the same error message.
Could any of you please help me in this regard ?
Thanks in advance.
Wilson
Edit: Sorted out. Somehow it is working now after specifying Remote server collation to true and Collation Name as 'SQL_Latin_General_CP1_CS_AS'
Moving code from Sybase to SQL Server 2005. I have two tables. One table (vINID) is reset and populated right before this code runs. The other table (vINPA) is a table in the database used by the Front End App. This is the error I get when I try and run on our SQL Server 2005.
Msg 468, Level 16, State 9, Line 1 Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_BIN" in the equal to operation.
Here is the SQL code:
SELECT DISTINCT vINID.BLEI_CK, vINID.BLIV_ID, ISNULL(vINPA.RCPT_AMT,0) AS RCPT_AMT
FROM Reporting_DEV.dbo.RPT_04597_INID AS vINID -- table re-populated
LEFT JOIN fauafpr0_pids.dbo.CDS_INPA_PMT_ACT AS vINPA ON vINPA.BLIV_ID = vINID.BLIV_ID
I am working with replicated data from an old mainframe app which I have no control over, I would haev done it totally differently. Most of the fields are chr(6) with following SQL_Latin1_General_CP437_BIN. But our database's COLLATION is SQL_Latin1_General_CP1_CI_AS. Therefore the need to use COLLATE syntax. I fear that this is very problematic. Will it affect performance when trying to do joins with the COLLATE syntax? COLLATE works but how efficient is it?
I'm extracting data from a source column with datatype varchar(80) and loading into a target column of data type nvarchar(80). Both the source column and target column have the same collation SQL_Latin1_General_CP1_CI_AS.
The target column has a unique constraint which fails during the data load operation.Upon investigation I found that the two strings below are considered the same in the target column of datatype nvarchar(80) :
'Malteser Schloßschule' 'Malteser Schlossschule'
I've tried to repro it using the T-SQL statements below, but can't understand why the second ALTER DDL fails.
ALTER TABLE TargetTable ADD CONSTRAINT UIXTemp1 UNIQUE (name) -- Above DDL Fails with the error message below : Msg 1505, Level 16, State 1, Line 1 The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.TEMP1' and the index name 'UIXTemp1'. The duplicate key value is (Malteser Schlossschule). Msg 1750, Level 16, State 0, Line 1 Could not create constraint. See previous errors.
For some reason in the TargetTable the strings 'Malteser Schloßschule' ,'Malteser Schlossschule' are the same. Using the similar T-SQL to query the SourceTable and TargetTable returns two different results while I expected the results to be same .
SELECT * FROM SourceTable WHERE name ='Malteser Schlossschule'
-- Results 'Malteser Schlossschule'
SELECT * FROM TargetTable WHERE name ='Malteser Schlossschule'