<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>collation Archives - Dragonsoft Technology View</title>
	<atom:link href="https://blog.dragonsoft.us/tag/collation/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.dragonsoft.us/tag/collation/</link>
	<description>Talk about Technologies, Software Architecture and Management</description>
	<lastBuildDate>Sat, 02 May 2009 19:01:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://blog.dragonsoft.us/wp-content/uploads/2022/04/logo-main-bw-150x150.png</url>
	<title>collation Archives - Dragonsoft Technology View</title>
	<link>https://blog.dragonsoft.us/tag/collation/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">2577970</site>	<item>
		<title>SQL Server Collation. An enemy or a friend?</title>
		<link>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/</link>
					<comments>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/#comments</comments>
		
		<dc:creator><![CDATA[Serguei Dosyukov]]></dc:creator>
		<pubDate>Wed, 16 Apr 2008 00:51:35 +0000</pubDate>
				<category><![CDATA[Fun stuff with SQL Server]]></category>
		<category><![CDATA[change database collation]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[collationname]]></category>
		<category><![CDATA[sql server]]></category>
		<guid isPermaLink="false">http://blog.dragonsoft.us/?p=167</guid>

					<description><![CDATA[<p>Is SQL Server Collation setting your enemy or your friend? How to change server default collation? In general, it is your friend, it will help SQL Server to figure out how to store character strings in different locale. It becomes even more important when data you are storing goes beyond<a class="moretag" href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/"> Read more</a></p>
<p>The post <a href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/">SQL Server Collation. An enemy or a friend?</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Is SQL Server Collation setting your enemy or your friend? How to change server default collation?</p>
<p>In general, it is your friend, it will help SQL Server to figure out how to store character strings in different locale. It becomes even more important when data you are storing goes beyond regular ANSI charset (Chinese, Japanese, etc.).</p>
<p>In my case I, from time to time work with Cyrillic. Being born and raised in Russia, I am native Russian speaker. As a result I am keeping Cyrillic enabled on my machine as main locale setting.</p>
<p>It is OK in many instances, but when it comes to SQL Server or some other applications which are trying to be smart in this area, it becomes a problem.</p>
<p>If you install SQL Server instance in such environment, you would get something like that</p>
<p>Let check collation for some database I have</p>
<pre class="brush: sql; title: ; notranslate">SELECT databasepropertyex(db_name(),'collation') AS collation_name</pre>
<p>In my case result would be</p>
<p> Cyrillic_General_CI_AS</p>
<p>If you are at home, it may be fine, but at work when your primary locale is SQL_Latin1_General_CP1_CI_AS<br />
it could be a problem since you often will run into error when execution of the SQL code across different databases will return Collation error.</p>
<p>Too late? Not exactly.</p>
<p>In many cases your solution would be to adjust Collation setting for the database using to following code:</p>
<pre class="brush: sql; title: ; notranslate">ALTER DATABASE DatabaseName COLLATE SQL_Latin1_General_CP1_CI_AS</pre>
<p>Problem would still exist though, any new database created will get default Collation setting from &#8230; MASTER database for your SQL Server Instance.</p>
<p> And here some hoops will be required. Following steps will help you overcome the issue:</p>
<ol>
<li>Detach all your user databases</li>
<li>Stop your SQL Server</li>
<li>In <strong>C:\Program Files\Microsoft SQL Server\80\Tools\Binn\</strong> folder locate <strong>rebuildm.exe</strong> and run it. This utility which comes with SQL Server (you will need to have client tools to be installed) allows you to repair your master database from original installation CD/DVD/Folder and also change default Collation Setting for your SQL Server instance. Go to Settings and choose appropriate collation designator or SQL Collation.<br />
If you cannot find rebuildm.exe, it means you are using SQL Server 2005 or 2008. Then the following may help:<br />
<a href="http://msdn.microsoft.com/en-us/library/ms144259(SQL.90).aspx" target="_blank">for SQL Server 2005</a></p>
<pre class="brush: plain; title: ; notranslate">
start /wait &lt;CD or DVD Drive&gt;\setup.exe /qn INSTANCENAME=&lt;InstanceName&gt; REINSTALL=SQL_Engine REBUILDDATABASE=1 SAPWD=&lt;NewStrongPassword&gt;</pre>
<p><a href="http://blogs.msdn.com/psssql/archive/2008/08/29/how-to-rebuild-system-databases-in-sql-server-2008.aspx" target="_blank">for SQL Server 2008</a></p>
<pre class="brush: plain; title: ; notranslate">
setup.exe  /QUIET  /ACTION=REBUILDDATABASE  /INSTANCENAME=instance_name  /SQLSYSADMINACCOUNTS= accounts   &#x5B;/SAPWD=password]
</pre>
</li>
<li>Rebuild your master database</li>
<li>Reattach your user databases</li>
<li>Check that collation for master and user databases is a desired using first query above.</li>
</ol>
<p>This is much easier then to recreate a SQL Server instance from scratch.</p>
<p><strong>Note. </strong>There is less safe way of getting the same result &#8211; adjust Windows Registry.<br />
Your default collation name is stored under</p>
<pre class="brush: sql; title: ; notranslate">HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer\
DefaultCollationName</pre>
<hr/><span style="font-size: 7pt">Copyright &copy; 2026 <strong><a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a></strong>. This Feed is for personal non-commercial use only.</span><p>The post <a href="https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/">SQL Server Collation. An enemy or a friend?</a> appeared first on <a href="https://blog.dragonsoft.us">Dragonsoft Technology View</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.dragonsoft.us/2008/04/15/sql-server-collation-an-enemy-or-a-friend/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">167</post-id>	</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Minified using Disk
Database Caching 15/83 queries in 0.086 seconds using Disk

Served from: blog.dragonsoft.us @ 2026-06-15 05:46:10 by W3 Total Cache
-->