We currently install some of client's databases on SQL Server 2000 with the collation set to Latin1_General_BIN but we have one client that was installed and now running on SQL_Latin1_General_CP1_CI_AS and I was wondering if we can change the collation on the database to Latin1_General_BIN?
Would this have any adverse affects on the DB or the data within it? Our strings are nvarchar.
I currently have a server with the collation set to SQL_Latin1_General_CP1_CI_AS.
However, some of the databases within the server are set to Latin1_General_BIN, probably because they were restored from another server some time ago. Also, even within the databases that have Latin1_General_BIN, some of the columns are set to SQL_Latin1_General_CP1_CI_AS, very confusing to say the least.
What i would like to do is change the database collation settings for these databases to match the server setting. I would also like to change all of the tables within these databases to have the columns also set to the server collation settings.
I'm looking for the steps that i would need to take to make sure i don't mess anything up as these databases have there own sets of views and sp's that run each day.
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?
When I migrated data from one SQL Server to another I got collection problems because collation of the target server was different from the source one.
The best solution I thought about was to change collation of the database in target server to be equal to the server collation so that when a temporary table is created, and the collation used would be the server collation, no error would occur. All sounds logic, but, after I ran ALTER DATABASE command and changed the collation of the database, I verified that all varchar fields of all database tables retained the old collation, not the new database collation I set.
Is there any way to change the collation of all fields at once when I change the database collation?
I have a database in SQL Server 2005 Express edition in standard collation. And now I need to store data including letter "è" (I'm from Slovenia). Can please someone tell me how to change the collation in server and database, please?
I need to change the default collation of all dbs on all my servers to SQL_Latin1_General_CP1_CI_AI from SQL_Latin1_General_CP1_CI_AS. We need to do compares and sorts and want to ignore accents -- something that wasn't clear when we built the servers. I know this has to do with "re-building databases" -- maybe even including the master -- but I'm not certain exactly what this means. Thanks!
I support an applicatoin where the vendor requires the use of the LATIN_1_GENERAL_BIN sort collation in their user databases. Origionally, when I installed the instance, I did not select this sort collation for the instance. I have since gone back and reinstalled SQL Server with the correct sort collation. After that, I restored the vendors databases from backups I took prior to reinstalling the instnace and they retained the LATIN_1_GENERAL_BIN collation (the correct one).
I also restored the MSDB database to get all of my jobs back. When I did this, MSDB took the old sort collation (SQL_LATIN_1_GENERAL_CPI_CI_AS). MSDB is the only database that has this collation and I'm getting errors in the agent log complaining of collation conflicts. I'm pretty sure the fact that the MSDB sort collation is different that all the other databases is the thing that's causing these error messages.
My question is this: Is there any way to change the sort collation of MSDB without reinstalling SQL server? This is a clustered environment and everytime I've reloaded SQL, it's been cumbersome and taken me at least 1 day's work.
Also, I know there's a rebuild master utility that will rebuild master, model and MSDB, but when I tried that last time it failed and I had to reinstall SQL anyway. Does anyone know of a way around this or have any tips on using the rebuildmaster utility in a clustered environment?
I am trying to change the name collation of a SQL database as an update script I am running needs the main collation to be SQL_Latin1_General_CP1_CI_AS
I have tried going into Properties and options then changing the collation type but I get this error
"The Database could not be exclusively locked to perform the operation. ALTER DATABASE failed. The default collation of database 'nutri93' cannot be set to SQL_Latin1_General_CP1_CI_AS."
I have tried SQL scripts that I have found to take the database into a single user mode but still get the same errror.
Usually its this Database nutri93 could not be locked exclusively
How I can change the collation type? Currently the only option seems to be a complete hard install of SQL Management Studio
i would like to change all my dbs to have the same collation, i wasnt involved in the creation of these dbs and therefor cant judge if this will be a dangrous thing to do... but itll help to change when performing queries, arre there any dangers in doing this?
Hi. I don't know how to change the collation in SQL Server 2000, my collation is Modern_Spanish_CI_AS, if somedoby knows the procedure to change the collation I would be thankful. Thank you again and best regards. Christian
I have a DB which has its collation set to SQL_Latin1_General_CP1_CI_AS and i need to change it to Latin1_General_CI_AS,
does anyone have any idea how to do this?
i have tried right clicking on the DB and changing its collation in the options tab, but this only changes what the default is, so all the old columns still have the old collatin,
Hi,I'm installing SQL2000 on a new cluster server.I selected a 'custom installation' and was presented with a'Collation settings' screen.I need it to be SQL_Latin1_General_CP1_CI_AS collationas I will be restoring databases with this collation.What should I choose from the 'Collation designator' and 'SQLCollations' box.Is it 'Dictionary order, case-insensitive, for use with 1252characters'?What will be the default? Will it be the same default as for the'typical' installation?Thanks
I'm importing data from a table on one database into a table in another database on the same instance. The FROM database is collated as "Latin1_General_CI_AS" and the TO database is collated as "SQL_Latin1_General_CP1_CI_AS".
When I then try joining on a common nvarchar column between the 2 tables, I get this error:
Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation.
Is there a way to change the collation of the incoming data as I'm inserting it into the TO table?
I have a client who was installed improperly on a Case InsensitiveCollation SQL system and have been working with this system for over ayear. For them to move forward in application software versions, theywill need to be reinstalled on a Case Sensitive SQL system. I waswondering if anyone has tried this and was willing to provideinformation that may be of assistance? I have tried various someoptions within DTS but without success.
Is there a way (besides "ALTER DATABASE COLLATE ...") to change collation name for the whole database? I tried to use the "ALTER DATABASE" command, but it didn't work. And I wouldn't like to run "ALTER COLUMN" commands for over 100 tables.
I have to create a database (SQL2005) for multinational usage (Western, Eastern and asian langages included).
This database will be used by an international application.
Here are my questions :
* All the "wording" of the application will come from NVARCHAR database fields. However, for database fields which will not store any possibilities of special characters (and will not be shown on the application), should I also use NVARCHAR fields ?
(Then, the database will mix unicode and non unicode strings)
* The database must be replicated (transactional or Merge) with an "old" non international database on SQL 2000. Schemas are near the same, only datatype are different (varchar --> nvarchar). Then, should I use a SQL collation instead of Windows Collation as advised on MSDN ? http://msdn2.microsoft.com/en-us/library/ms175194.aspx
(MS tells to use Windows collation if the database has unicode and and non-unicode strings, but It also tells to use SQL collation to maintain compatibility with earlier versions of SQL)
There have been several threads about changing a database's collation but none have come up with an easy answer before. The suggestion before was to create an empty database with the correct collation and then copy the data across. However this is hard work as you have to populate tables in a specific order in order not to violate foreign keys etc. You can't just dts the whole data.
There follows scripts we have written to do the job. If people use them, please could you add to this thread whether they worked successfully or not.
Firstly we change the default collation, then change all the types in the database to match the new collation.
=================== --script to change database collation - James Agnini -- --Replace <DATABASE> with the database name --Replace <COLLATION> with the collation, eg SQL_Latin1_General_CP1_CI_AS -- --After running this script, run the script to rebuild all indexes
ALTER DATABASE <DATABASE> COLLATE <COLLATION>
exec sp_configure 'allow updates',1 go reconfigure with override go update syscolumns set collationid = (select top 1 collationid from systypes where systypes.xtype=syscolumns.xtype) where collationid <> (select top 1 collationid from systypes where systypes.xtype=syscolumns.xtype) go exec sp_configure 'allow updates',0 go reconfigure with override go ===================
As we have directly edited system tables, we need to run a script to rebuild all the indexes. Otherwise you will get strange results like comparing strings in different table not working. The indexes have to actually be dropped and recreated in separate statements. You can't use DBCC DBREINDEX or create index with the DROP_EXISTING option as they won't do anything(thanks to SQL Server "optimization"). This script loops through the tables and then loops through the indexes and unique constraints in separate sections. It gets the index information and drops and re-creates it. (The script could probably be tidied up with the duplicate code put into a stored procedure).
==================== --Script to rebuild all table indexes, Version 0.1, May 2004 - James Agnini -- --Database backups should be made before running any set of scripts that update databases. --All users should be out of the database before running this script
print 'Rebuilding indexes for all tables:' go
DECLARE @Table_Name varchar(128) declare @Index_Name varchar(128) declare @IndexId int declare @IndexKey int
DECLARE Table_Cursor CURSOR FOR select TABLE_NAME from INFORMATION_SCHEMA.tables where table_type != 'VIEW'
OPEN Table_Cursor FETCH NEXT FROM Table_Cursor INTO @Table_Name
--loop through tables WHILE @@FETCH_STATUS = 0
BEGIN print '' print @Table_Name
DECLARE Index_Cursor CURSOR FOR select indid, name from sysindexes where id = OBJECT_ID(@Table_Name) and indid > 0 and indid < 255 and (status & 64)=0 and not exists(Select top 1 NULL from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = @Table_Name AND (CONSTRAINT_TYPE = 'PRIMARY KEY' or CONSTRAINT_TYPE = 'UNIQUE') and CONSTRAINT_NAME = name) order by indid
OPEN Index_Cursor FETCH NEXT FROM Index_Cursor INTO @IndexId, @Index_Name
--loop through indexes WHILE @@FETCH_STATUS = 0 begin
declare @SQL_String varchar(256) set @SQL_String = 'drop index ' set @SQL_String = @SQL_String + @Table_Name + '.' + @Index_Name
set @SQL_String = @SQL_String + 'index ' set @SQL_String = @SQL_String + @Index_Name set @SQL_String = @SQL_String + ' on ' set @SQL_String = @SQL_String + @Table_Name
set @SQL_String = @SQL_String + '('
--form column list SET @IndexKey = 1
-- Loop through index columns, INDEX_COL can be from 1 to 16. WHILE @IndexKey <= 16 and INDEX_COL(@Table_Name, @IndexId, @IndexKey) IS NOT NULL BEGIN
IF @IndexKey != 1 set @SQL_String = @SQL_String + ','
set @SQL_String = @SQL_String + index_col(@Table_Name, @IndexId, @IndexKey)
SET @IndexKey = @IndexKey + 1 END
set @SQL_String = @SQL_String + ')'
print @SQL_String EXEC (@SQL_String)
FETCH NEXT FROM Index_Cursor INTO @IndexId, @Index_Name end
CLOSE Index_Cursor DEALLOCATE Index_Cursor
--loop through unique constraints DECLARE Contraint_Cursor CURSOR FOR select indid, name from sysindexes where id = OBJECT_ID(@Table_Name) and indid > 0 and indid < 255 and (status & 64)=0 and exists(Select top 1 NULL from INFORMATION_SCHEMA.TABLE_CONSTRAINTS where TABLE_NAME = @Table_Name AND CONSTRAINT_TYPE = 'UNIQUE' and CONSTRAINT_NAME = name) order by indid
OPEN Contraint_Cursor FETCH NEXT FROM Contraint_Cursor INTO @IndexId, @Index_Name
--loop through indexes WHILE @@FETCH_STATUS = 0 begin
set @SQL_String = 'alter table ' set @SQL_String = @SQL_String + @Table_Name set @SQL_String = @SQL_String + ' drop constraint ' set @SQL_String = @SQL_String + @Index_Name
set @SQL_String = @SQL_String + '; alter table ' set @SQL_String = @SQL_String + @Table_Name set @SQL_String = @SQL_String + ' WITH NOCHECK add constraint ' set @SQL_String = @SQL_String + @Index_Name set @SQL_String = @SQL_String + ' unique '
I have an O2 Xda IIs Pocket PC running PPC 2003 SE, WWE (Worldwide English) edition.
I want to create a database which contains all Chinese characters that have been mapped under the Unicode Standard. I already have a similar database on my desktop PC. On my desktop PC, I have used the collation Chinese_Hong_Kong_Stroke_90_CI_AS. However, on my Pocket PC, I do not see any Chinese or even Unicode sort orders. The best I get is "General".
I want to use the Chinese sort order to govern the way the characters are sorted (ie., characters with fewer strokes appear first).
How am I able to do this? / Is there anything extra that I may install to make additional collations available?
I have two databases with different collation sequences, let them be called A (SQL_Latin1_General_CI_AS) and B (Latin1_General_CI_AS). Now I need to join between the two (including through temp tables with server collation being Latin1_General_CI_AS). In order to get rid of the errors when trying to do so I changed all my statements in the WHERE and ON clauses to
If I were to change the collation of the character typed columns in database A to the one in database B, would it make any difference in terms of performance, or would it just be a useless exercise? Just asking because many of those columns are part of a primary or foreign key that would need to first be dropped and then recreated after changing the collation, and I'd prefer to save myself the effort of writing scripts to do so if the answer is NO.
BTW, I tried to change the database's collation sequence, but that leaves the collation of the columns unchanged.
Hi,Can anyone advice me which is commonly used collation name for adatabase that store Korean characters as there are a few options like"Korean_Wansung_Bin, etc.."?
My application supports multiple languages/locales in a single database. Some of our new customers want to support Chinese, Japanese, Korean, Italian, Spanish, and German in addition to English. Supporting the Latin based languages is not a problem. But I am having trouble finding a collation sequence that allows me to store the other double byte languages in the same database correctly.
I have found changing the data types from text, char, varchar to ntext, nchar, nvarchar and adding an N in front of the various strings that getting inserted seems to work:
insert into CONTENTDATA (recordid, xml) values (newid(), N'<CHANNEL1><FILE1/><TEXT1><![CDATA[和红魔拉拉队的动感精神 ]]></TEXT1><TEXT3><![CDATA[和红魔拉拉队的动感精神]]></TEXT3></CHANNEL1>');
But this is not going to be a practical solution for us. Is there a collation sequence that would allow us to store multiple locales like we do in Oracle (AL32UTF8)?
I've been tasked with supporing Polish on a program that was written as single byte. I have the basics working, but need to find out what the best collation for SQL 2005 is, or justification for testing and supporting both collations.
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?
Complete: SetPackageInstallStateAction at: 2007/9/23 7:33:43, returned true Running: DeterminePackageTransformsAction at: 2007/9/23 7:33:43 Complete: DeterminePackageTransformsAction at: 2007/9/23 7:33:43, returned true Running: ValidateSetupPropertiesAction at: 2007/9/23 7:33:43 Complete: ValidateSetupPropertiesAction at: 2007/9/23 7:33:43, returned true Running: OpenPipeAction at: 2007/9/23 7:33:43 Complete: OpenPipeAction at: 2007/9/23 7:33:43, returned false Error: Action "OpenPipeAction" failed during execution. Running: CreatePipeAction at: 2007/9/23 7:33:43 Complete: CreatePipeAction at: 2007/9/23 7:33:43, returned true Running: RunRemoteSetupAction at: 2007/9/23 7:33:43 <Func Name='CProcessCtrl::GetInstallPath'> <EndFunc Name='CProcessCtrl::GetInstallPath' Return='0' GetLastError='0'> Error: 0x80070050 TaskScheduler::NewWorkItem for SQL Server Remote Setup Error: 0x80070005 TaskSchedulerWorkItem failed to save the task [SQL Server Remote Setup ] Complete: RunRemoteSetupAction at: 2007/9/23 7:33:43, returned false Error: Action "RunRemoteSetupAction" failed during execution. Error information reported during run: Attempting to determine log files for remote install. Connection to remote computer's scheduler service. Creating new workitem. Deleting existing work item and trying again... Starting remote setup onSQL1N2 Error: 80070005 Access is denied. Running: PopulateMutatorDbAction at: 2007/9/23 7:33:43 Complete: PopulateMutatorDbAction at: 2007/9/23 7:33:43, returned true Running: GenerateRequestsAction at: 2007/9/23 7:33:43 SQL_Engine = 3 SQL_Data_Files = -1 SQL_Replication = -1 SQL_FullText = -1 SQL_SharedTools = -1 SQL_BC_DEP = -1 Analysis_Server = -1 AnalysisDataFiles = -1 AnalysisSharedTools = -1 RS_Server = -1 RS_Web_Interface = -1 RS_SharedTools = -1 Notification_Services = -1 NS_Engine = -1 NS_Client = -1 SQL_DTS = -1 Client_Components = -1 Connectivity = -1 SQL_Tools90 = -1 SQL_WarehouseDevWorkbench = -1 SDK = -1 SQLXML = -1 Tools_Legacy = -1 TOOLS_BC_DEP = -1 SQL_SSMSEE = -1 SQL_Documentation = -1 SQL_BooksOnline = -1 SQL_DatabaseSamples = -1 SQL_AdventureWorksSamples = -1 SQL_AdventureWorksDWSamples = -1 SQL_AdventureWorksASSamples = -1 SQL_Samples = -1 Complete: GenerateRequestsAction at: 2007/9/23 7:33:44, returned true Running: CreateProgressWindowAction at: 2007/9/23 7:33:44 Complete: CreateProgressWindowAction at: 2007/9/23 7:33:44, returned false Error: Action "CreateProgressWindowAction" failed during execution. Running: ScheduleActionAction at: 2007/9/23 7:33:44 Complete: ScheduleActionAction at: 2007/9/23 7:33:45, returned true Skipped: InstallASAction.11 Waiting for actions from remote setup(s) Breaking wait state and aborting package due to cancel code received: 1602 Remote setup(s) are ready Notify package action is determined: 1602 Error Code: 0x800700e9 (233) Windows Error Text: No process is on the other end of the pipe.
Source File Name: remotemessageliboverlappedpipelistener.cpp Compiler Timestamp: Sat Oct 7 09:43:54 2006 Function Name: sqls:verlappedPipeListener::writePipe Source Line Number: 294
Notification failed to send. ---- Context ----------------------------------------------- sqls::HostSetupPackageInstallerSynch::installAction
Removing machine from list of targets to sync. Skipped: Action "InstallASAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "as", will not be installed. Skipped: InstallASAction.18 Skipped: Action "InstallASAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "as", will not be installed. Skipped: InstallASAction.22 Skipped: Action "InstallASAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "as", will not be installed. Skipped: InstallASAction.9 Skipped: Action "InstallASAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "as", will not be installed. Skipped: InstallDTSAction Skipped: Action "InstallDTSAction" was not run. Information reported during analysis: All installs have been cancelled, so package: "dts", will not be installed. Skipped: InstallDTSAction.11 Skipped: Action "InstallDTSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.12 Skipped: Action "InstallDTSAction.12" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlncli", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.18 Skipped: Action "InstallDTSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.22 Skipped: Action "InstallDTSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "dts", will not be installed. Skipped: InstallDTSAction.9 Skipped: Action "InstallDTSAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "dts", will not be installed. Skipped: InstallNSAction Skipped: Action "InstallNSAction" was not run. Information reported during analysis: All installs have been cancelled, so package: "ns", will not be installed. Skipped: InstallNSAction.11 Skipped: Action "InstallNSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "ns", will not be installed. Skipped: InstallNSAction.12 Skipped: Action "InstallNSAction.12" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlncli", referred by package: "ns", will not be installed. Skipped: InstallNSAction.18 Skipped: Action "InstallNSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "ns", will not be installed. Skipped: InstallNSAction.22 Skipped: Action "InstallNSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "ns", will not be installed. Skipped: InstallNSAction.9 Skipped: Action "InstallNSAction.9" was not run. Information reported during analysis: All installs have been cancelled, so package: "msxml6", referred by package: "ns", will not be installed. Skipped: InstallRSAction.11 Skipped: Action "InstallRSAction.11" was not run. Information reported during analysis: All installs have been cancelled, so package: "sqlsupport", referred by package: "rs", will not be installed. Skipped: InstallRSAction.18 Skipped: Action "InstallRSAction.18" was not run. Information reported during analysis: All installs have been cancelled, so package: "owc11", referred by package: "rs", will not be installed. Skipped: InstallRSAction.22 Skipped: Action "InstallRSAction.22" was not run. Information reported during analysis: All installs have been cancelled, so package: "bcRedist", referred by package: "rs", will not be installed. Skipped: InstallSqlAction Clustered feature detected: SQL_Engine Clustered feature detected: SQL_FullText Loaded DLL:C:Program FilesMicrosoft SQL Server90Setup Bootstrapsqlsval.dll Version:2005.90.3042.0 Windows Error Text: User cancelled installation.
Source File Name: sqlchainingsqlchainingactions.cpp Compiler Timestamp: Thu Nov 16 20:32:00 2006 Function Name: sqls::ReportChainingResults:erform Source Line Number: 3667
---- Context ----------------------------------------------- sqls::RunRemoteSetupAction::waitForRemoteSetupComplete king package: "patchRS2000" as failed due to cancel code received from cancel source: 1602 sqls Delay load of action "UploadDrWatsonLogAction" returned nothing. No action will occur as a result. Message pump returning: 1602
I have just upgraded to SQL Server 2005 from SQL Server 2000.In Microsoft SQL Server Management Studio, when I click on databaseproperties, I receive the following error:-Cannot resolve the collation conflict between"Latin1_General_CI_AS"and "SQL_Latin1_General_CP1_CI_AS" in the equal to operation.(Microsoft SQL Server, Error: 468)Some reference suggest that I can change the database collation byclicking database properties!What can I do?
hi, I have created a database in sql server 2000. I need to duplicate the database under different name, how can I do that? Also, can I rename a database name? thanks Ali
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?