<?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>character set &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/character-set/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Thu, 16 Nov 2017 13:25:29 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-7)</title>
		<link>https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 18 Jun 2016 20:01:17 +0000</pubDate>
				<category><![CDATA[SQL Server Interview]]></category>
		<category><![CDATA[answers]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Database Developer]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Interviews]]></category>
		<category><![CDATA[linked server]]></category>
		<category><![CDATA[questions]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[T-SQL]]></category>
		<category><![CDATA[triggers]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[user defined function]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3051</guid>

					<description><![CDATA[What are the advantages of User defined Function? You can create the function once, store it in the database, and call it any number of times in your program. Similar to stored procedures, Transact-SQL user-defined functions reduce the compilation cost of Transact-SQL code by caching the plans and reusing them for repeated executions. An operation [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&amp;linkname=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F06%2Fsql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7%2F&#038;title=SQL%20Server%3A%20Database%20Developer%20%28T-SQL%29%20Interview%20Questions%20and%20Answers%20%28Day-7%29" data-a2a-url="https://www.dbrnd.com/2016/06/sql-server-database-developer-t-sql-interview-questions-and-answers-udf-scalar-function-ddl-dml-trigger-linked-server-collation-day-7/" data-a2a-title="SQL Server: Database Developer (T-SQL) Interview Questions and Answers (Day-7)"></a></p><p><strong>What are the advantages of User defined Function?</strong></p>
<ul>
<li>You can create the function once, store it in the database, and call it any number of times in your program.</li>
<li>Similar to stored procedures, Transact-SQL user-defined functions reduce the compilation cost of Transact-SQL code by caching the plans and reusing them for repeated executions.</li>
<li>An operation that filters data based on some complex constraint that cannot be expressed in a single scalar expression can be expressed as a function.</li>
</ul>
<p><strong>What is a scalar function in SQL Server?</strong></p>
<blockquote><p>A scalar-valued function (SVF) returns a single value, such as a string, integer, or bit value.You can create scalar-valued user-defined functions in managed code using any .NET Framework programming language.</p></blockquote>
<p><strong>Can you write dynamic SQL in User defined Function?</strong></p>
<blockquote><p>No: we cannot perform dynamic SQL in a User defined function.</p>
<p>We should re-write our function to not require dynamic SQL.</p></blockquote>
<p><strong>Have you created DDL Trigger?</strong></p>
<blockquote><p>Yes:</p>
<p>DDL triggers fire in response to a variety of Data Definition Language (DDL) events. These events primarily correspond to Transact-SQL statements that start with the keywords CREATE, ALTER, DROP, GRANT, DENY, REVOKE or UPDATE STATISTICS.</p></blockquote>
<p><strong>In which scenarios, you require to create DDL Triggers?</strong></p>
<ul>
<li>Prevent certain changes to your database schema.</li>
<li>Have something occur in the database in response to a change in your database schema.</li>
<li>Record changes or events in the database schema.</li>
</ul>
<p><strong>What are the basic system tables to find information about the Triggers?</strong></p>
<ul>
<li>sys.trigger_event_types</li>
<li>sys.triggers</li>
<li>sys.triggers</li>
<li>sys.server_triggers</li>
</ul>
<p><strong>What is a DML trigger?</strong></p>
<blockquote><p>DML triggers is a special type of stored procedure that automatically takes effect when a data manipulation language (DML) event takes place that affects the table or view defined in the trigger. DML events include INSERT, UPDATE, or DELETE statements. DML triggers can be used to enforce business rules and data integrity, query other tables, and include complex Transact-SQL statements.</p></blockquote>
<p><strong>What is an AFTER TRIGGER?</strong></p>
<blockquote><p>AFTER triggers are executed after the action of the INSERT, UPDATE, MERGE, or DELETE statement is performed. AFTER triggers are never executed if a constraint violation occurs; therefore, these triggers cannot be used for any processing that might prevent constraint violations.</p></blockquote>
<p><strong>What is an INSTEAD OF TRIGGER?</strong></p>
<blockquote><p>INSTEAD OF triggers override the standard actions of the triggering statement. Therefore, they can be used to perform error or value checking on one or more columns and the perform additional actions before insert, updating or deleting the row or rows.</p>
<p>The primary advantage of INSTEAD OF triggers is that they enable views that would not be updatable to support updates.</p>
<p>Another advantage of INSTEAD OF triggers is that they enable you to code logic that can reject parts of a batch while letting other parts of a batch to succeed.</p></blockquote>
<p><strong>What is a Logon Triggers?</strong></p>
<blockquote><p>Logon triggers fire stored procedures in response to a LOGON event. This event is raised when a user session is established with an instance of SQL Server. Logon triggers fire after the authentication phase of logging in finishes, but before the user session is actually established.</p></blockquote>
<p><strong>T-SQL Script to disable/enable the triggers.</strong></p>
<blockquote><p><strong>To Disable:</strong></p><pre class="crayon-plain-tag">DISABLE Trigger ALL ON ALL SERVER;
DISABLE TRIGGER Trigger_Name ON DATABASE;
DISABLE TRIGGER Trigger_Name ON db.table_name;</pre><p>
<strong>To Enable:</strong></p><pre class="crayon-plain-tag">ENABLETrigger ALL ON ALL SERVER;
ENABLETRIGGER Trigger_Name ON DATABASE;
ENABLETRIGGER Trigger_Name ON db.table_name;</pre><p>
</p></blockquote>
<p><strong>What is a Linked Server?</strong></p>
<blockquote><p>Another question that can tell you if the candidate has experience with distributed databases is &#8220;What is a Linked Server?&#8221; A linked server is a reference from one SQL Server server to another. If you have databases on another SQL Server server that contains data you need for your system, you could create a link server on your server to the other SQL Server server. Then, you can use the four-part name of the remote table to use it within your local queries.</p></blockquote>
<p><strong>What is a four-part name?</strong></p>
<blockquote><p>This question can help you get a sense for whether the candidate ever crosses database boundaries with his queries. A four-part name refers to the parts of a SQL Server object name that uniquely identifies it in the SQL environment. The first part is the instance. The second part is the database. Third is the schema and fourth is the object name. for example, linkd1.db_name.dbo.table_name.</p></blockquote>
<p><strong>What does a cardinality of zero mean?</strong></p>
<blockquote><p>Well, if a column has a cardinality of zero, it means that the column has no unique values. This could potentially happen if the column has all NULL’s – which means that the column was never really used anyways.</p></blockquote>
<p><strong>How can you delete duplicate records using SET ROWCOUNT?</strong></p>
<blockquote><p>Use the SET ROWCOUNT command. For instance, if you have 2 duplicate rows, you would SET ROWCOUNT 1, execute DELETE command and then SET ROWCOUNT 0.</p></blockquote>
<p><strong>What is Delegation in SQL Server?</strong></p>
<blockquote><p>SQL Server and Windows can be configured to enable a client connected to an instance of SQL Server to connect to another instance of SQL Server of forwarding the credentials of an authenticated Windows user.</p>
<p>This arrangement is known as delegation.</p></blockquote>
<p><strong>What is Character Set and Collation?</strong></p>
<blockquote class="wp-embedded-content" data-secret="VUBoYXUfMQ"><p><a href="https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/">Database Theory: What is Character Set and Collation</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/embed/#?secret=VUBoYXUfMQ" data-secret="VUBoYXUfMQ" width="600" height="338" title="&#8220;Database Theory: What is Character Set and Collation&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>How to find total Row Count of All Tables in a Database?</strong></p>
<blockquote class="wp-embedded-content" data-secret="nLeAHxJnOJ"><p><a href="https://www.dbrnd.com/2015/11/sql-server-script-to-find-total-row-count-of-all-tables-in-a-database/">SQL Server: Script to find total Row Count of All Tables in a Database</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/sql-server-script-to-find-total-row-count-of-all-tables-in-a-database/embed/#?secret=nLeAHxJnOJ" data-secret="nLeAHxJnOJ" width="600" height="338" title="&#8220;SQL Server: Script to find total Row Count of All Tables in a Database&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>How to find the last Executed Query using SPID?</strong></p>
<blockquote class="wp-embedded-content" data-secret="nnLyFdGO2G"><p><a href="https://www.dbrnd.com/2015/11/sql-server-script-to-find-the-last-executed-query-using-spid/">SQL Server: Script to find the last Executed Query using SPID</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/sql-server-script-to-find-the-last-executed-query-using-spid/embed/#?secret=nnLyFdGO2G" data-secret="nnLyFdGO2G" width="600" height="338" title="&#8220;SQL Server: Script to find the last Executed Query using SPID&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>&nbsp;</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Script to find default Character Set for Database, Table and Column</title>
		<link>https://www.dbrnd.com/2016/04/mysql-script-to-find-default-character-set-for-database-table-and-column/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 24 Apr 2016 20:08:28 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1743</guid>

					<description><![CDATA[In this post, I am sharing few scripts for finding the default character set of a MySQL Database, Table and Column. Generally, during the process of database migration, we are checking default character set and collation at MySQL Server level. But in our production MySQL Server, I found that some of the tables have different [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&#038;title=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" data-a2a-url="https://www.dbrnd.com/2016/04/mysql-script-to-find-default-character-set-for-database-table-and-column/" data-a2a-title="MySQL: Script to find default Character Set for Database, Table and Column"></a></p><p>In this post, I am sharing few scripts for finding the default character set of a MySQL Database, Table and Column.</p>
<p>Generally, during the process of database migration, we are checking default character set and collation at MySQL Server level.</p>
<p>But in our production MySQL Server, I found that some of the tables have different character set which was not required. </p>
<p>As a database professional, we have to maintain consistency between all database objects. </p>
<p><strong>Find default Characater Set for Database:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	default_character_set_name 
FROM information_schema.SCHEMATA 
WHERE schema_name = 'Database_Name';</pre> </p>
<p><strong>Find default Characater Set for Table:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	CCSA.character_set_name 
FROM information_schema.TABLES AS T
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS CCSA
	ON CCSA.collation_name = T.table_collation
WHERE T.table_schema = 'Database_Name'
  AND T.table_name = 'Table_Name';</pre> </p>
<p><strong>Find default Character Set for Column:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	character_set_name 
FROM information_schema.COLUMNS 
WHERE table_schema = 'Database_Name'
  AND table_name = 'Table_Name'
  AND column_name = 'Column_Name';</pre> </p>
<p><strong><code>Please Visit Other Related Articles !</code></strong></p>
<p><a href="https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/" target="_blank"></p>
<p><strong>Database Theory: What is Character Set and Collation</strong></a><br />
<a href="https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/" target="_blank"></p>
<p><strong>MySQL: How to change default Character set to UTF-8</strong></a><br />
<a href="https://www.dbrnd.com/2016/02/mysql-perform-case-sensitive-string-comparison/" target="_blank"></p>
<p><strong>MySQL: Perform Case Sensitive string comparison</strong></a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: How to change default Character set to UTF-8</title>
		<link>https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/</link>
					<comments>https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 30 Oct 2015 17:02:03 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[utf-8]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=962</guid>

					<description><![CDATA[In the previous post, I discussed and provided the small note on Database Character Set and Collation. In this post, I am showing how you can configure or change default Character Set in MySQL? Sometimes, it requires changing the default character set of MySQL Server or MySQL Database. A Character set &#8220;latin1&#8221; and Collation &#8220;latin1_swedish_ci&#8221; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&amp;linkname=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fmysql-how-to-change-default-character-set-to-utf-8%2F&#038;title=MySQL%3A%20How%20to%20change%20default%20Character%20set%20to%20UTF-8" data-a2a-url="https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/" data-a2a-title="MySQL: How to change default Character set to UTF-8"></a></p><p>In the previous post, I discussed and provided the small note on Database Character Set and Collation.<br />
In this post, I am showing how you can configure or change default Character Set in MySQL?</p>
<blockquote><p>Sometimes, it requires changing the default character set of MySQL Server or MySQL Database.<br />
A Character set &#8220;latin1&#8221; and Collation &#8220;latin1_swedish_ci&#8221; are the default of MySQL Server.</p>
<p>This is a standard configuration, and you do not need to change anything, but if your application requires storing data using a different character set, you have to change this default configuration.</p></blockquote>
<p><strong>Here, I am showing how to change your default character set and collation to UTF-8.</strong></p>
<p>MySQL Server provides, different three ways to configure character set and collation.</p>
<ul>
<li>Configure Character set and Collation at Database Level.</li>
<li>Configure Character set and Collation at Server Startup.</li>
<li>Configure Character set and Collation during MySQL Server Installation and Configuration.</li>
</ul>
<p><strong>First, check your default Character Set and Collation of MySQL Server.</strong></p><pre class="crayon-plain-tag">SHOW VARIABLES LIKE 'chara%'; 
SHOW VARIABLES LIKE 'collation%';</pre><p> </p>
<p><strong>If you want to change the default to UTF-8, you want to add the following to my.cnf (MySQL Configuration File).<br />
</strong></p>
<pre class="crayon-plain-tag">[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
collation-server = utf8_unicode_ci
init-connect='SET NAMES utf8'
character-set-server = utf8</pre> </p>
<p><strong>Specify Character Settings per Database:<br />
</strong></p>
<pre class="crayon-plain-tag">CREATE DATABASE MyDatabase
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Database Theory: What is Character Set and Collation</title>
		<link>https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/</link>
					<comments>https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 29 Oct 2015 18:26:59 +0000</pubDate>
				<category><![CDATA[Database Theory]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[collation]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database concept]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database standards]]></category>
		<category><![CDATA[database topic]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[latin1]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[utf-8]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=955</guid>

					<description><![CDATA[In this post, I am sharing small Database theory on Character Set and Collation. As we are Database Professionals and already experienced with &#8220;Collate&#8221; in SQL Server and MySQL. I found that fresher and intermediate Database Professional have doubt and question about Character Set and Collation. Let me clear this with a natural note. What [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&amp;linkname=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F10%2Fdatabase-theory-what-is-character-set-and-collation%2F&#038;title=Database%20Theory%3A%20What%20is%20Character%20Set%20and%20Collation" data-a2a-url="https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/" data-a2a-title="Database Theory: What is Character Set and Collation"></a></p><p>In this post, I am sharing small Database theory on Character Set and Collation.<br />
As we are Database Professionals and already experienced with &#8220;Collate&#8221; in SQL Server and MySQL.<br />
I found that fresher and intermediate Database Professional have doubt and question about Character Set and Collation.</p>
<p>Let me clear this with a natural note.</p>
<p><strong>What is Character Set?</strong></p>
<blockquote><p>A Character Set is nothing but just a list of symbols and encodings. </p>
<p>For example, latin1 and UTF-8 are the most traditional character set.<br />
Using latin1, you will be able to write all American words because latin1 contains all ASCII characters, which are sufficient to write an English word. On the contrary, with ASCII you will not be able to write all words of Western European specific languages because for instance, characters like &#8216;ë&#8217;, &#8216;õ&#8217;, &#8216;Ñ&#8217; are missing.</p>
<p>A Character Set encodes characters so that they fit in memory. For example,  the euro symbol, €, will be encoded as 0xa4, and in UTF-8, it will be 0xe282ac.</p></blockquote>
<p><strong>What is Collation?</strong></p>
<blockquote><p>A collation is a set of rules for comparing characters in a character set. It has also ruled for sorting of characters, and proper order of two characters varies from language to language.<br />
A Collation compared two strings like, if a word is greater than another one, and sort accordingly. </p>
<p>If you are using &#8220;latin1&#8221; Character set, you can use &#8220;latin1_swedish_ci&#8221; Collation.<br />
You have to choose right collation because wrong collation may affect your database performance.</p></blockquote>
<p><strong>Now create one database in MySQL using Character Set and Collation:</strong></p>
<pre class="crayon-plain-tag">CREATE DATABASE DatabaseName CHARACTER SET latin1 COLLATE latin1_swedish_ci;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
