<?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>Manvendra Deo Singh</title>
	<atom:link href="https://techyaz.com/author/manvendra/feed/" rel="self" type="application/rss+xml" />
	<link>https://techyaz.com/author/manvendra/</link>
	<description>Tips, Tutorials and How-to Topics</description>
	<lastBuildDate>Sun, 09 Apr 2023 09:14:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8</generator>

<image>
	<url>https://techyaz.com/wp-content/uploads/2017/11/cropped-Site-icon-150x150.png</url>
	<title>Manvendra Deo Singh</title>
	<link>https://techyaz.com/author/manvendra/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Fix SQL Error 1005: A Comprehensive Guide</title>
		<link>https://techyaz.com/mysql/how-to-fix-sql-error-1005-a-comprehensive-guide/</link>
					<comments>https://techyaz.com/mysql/how-to-fix-sql-error-1005-a-comprehensive-guide/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sun, 09 Apr 2023 09:14:33 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2792</guid>

					<description><![CDATA[<p>If you&#8217;re working with SQL databases, you might have encountered error 1005 at some point in your development process. SQL error 1005 is a common error that occurs when attempting to create or modify a table in a database. It&#8217;s&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/mysql/how-to-fix-sql-error-1005-a-comprehensive-guide/">How to Fix SQL Error 1005: A Comprehensive Guide</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;re working with SQL databases, you might have encountered error 1005 at some point in your development process. SQL error 1005 is a common error that occurs when attempting to create or modify a table in a database. It&#8217;s caused by various factors, such as incorrect syntax, data type mismatches, or foreign key constraints. But fear not! In this article, we will provide you with a comprehensive guide on how to fix SQL error 1005 and get your database back on track.</p>



<h2 class="wp-block-heading">What is MySQL Error Code 1005?</h2>



<p>SQL error 1005, also known as &#8220;Can&#8217;t create table (errno: 150)&#8221;, is a MySQL error that occurs when there is a problem with a foreign key constraint. Foreign key constraints are used to establish relationships between tables in a relational database. They ensure that data integrity is maintained by preventing actions that would create inconsistent or invalid data.</p>



<h2 class="wp-block-heading">Possible Causes</h2>



<p>When you encounter SQL error 1005, MySQL is telling you that there is an issue with a foreign key constraint while trying to create or modify a table. This error can be caused by a variety of reasons, such as:</p>



<ol class="wp-block-list" type="1">
<li><strong>Incorrect syntax: </strong>The foreign key constraint might not be defined properly, leading to a syntax error in your SQL statement.</li>



<li><strong>Data type mismatch:</strong> The data types of the columns involved in the foreign key constraint must match exactly. If there is a mismatch in data types, MySQL will throw error 1005.</li>



<li><strong>Missing referenced table:</strong> The table referred to in the foreign key constraint might not exist in the database.</li>



<li><strong>Incompatible foreign key constraint: </strong>The referenced table might have a foreign key constraint with incompatible attributes, such as different collation, character set, or storage engine.</li>



<li><strong>Circular reference:</strong> A circular reference occurs when two or more tables reference each other with foreign key constraints, creating a loop. MySQL does not allow circular references, and it will result in error 1005.</li>
</ol>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img fetchpriority="high" decoding="async" src="https://techyaz.com/wp-content/uploads/2023/04/sql-error-1005.jpg" alt="Fix SQL error 1005" class="wp-image-2793" width="349" height="185" srcset="https://techyaz.com/wp-content/uploads/2023/04/sql-error-1005.jpg 941w, https://techyaz.com/wp-content/uploads/2023/04/sql-error-1005-300x159.jpg 300w, https://techyaz.com/wp-content/uploads/2023/04/sql-error-1005-768x407.jpg 768w" sizes="(max-width: 349px) 100vw, 349px" /></figure></div>


<h2 class="wp-block-heading">Fix MySQL Error Code 1005</h2>



<p>Now that we have a basic understanding of SQL error 1005 and its possible causes, let&#8217;s dive into the solutions to fix this issue.</p>



<ol class="wp-block-list" type="1">
<li><strong>Check for typos or errors in your table definitions:</strong> Make sure that you have correctly defined your table columns, data types, and constraints. Double-check for any misspellings, missing or extra commas, and other syntax errors in your table definitions.</li>



<li><strong>Ensure that referenced columns and tables exist: </strong>If you are defining foreign key constraints, make sure that the referenced columns and tables actually exist in the database. If the referenced table has not been created yet, or if it has been dropped or renamed, you may encounter error code 1005.</li>



<li><strong>Check for conflicting constraints: </strong>If you have multiple foreign key constraints in your table definitions, ensure that there are no conflicts. For example, if you have two foreign keys that reference the same column in another table, MySQL will raise error code 1005. Make sure that your constraints are properly defined and do not conflict with each other.</li>



<li><strong>Verify data types and lengths: </strong>Make sure that the data types and lengths of the columns in your foreign key and referencing tables match exactly. Data type mismatches can result in error code 1005.</li>



<li><strong>Disable foreign key checks: </strong>You can temporarily disable foreign key checks in MySQL by running the following command before creating or modifying tables: SET FOREIGN_KEY_CHECKS = 0;. This can help you identify and fix any issues with foreign key constraints. However, be cautious when using this approach, as it can potentially lead to inconsistent data if not used properly.</li>



<li><strong>Check for circular references:</strong> If you have circular references in your foreign key constraints, where Table A references Table B and Table B references Table A, you will encounter error code 1005. To fix this issue, you may need to restructure your database schema to remove circular references.</li>



<li><strong>Check for storage engine compatibility:</strong> If you are using different storage engines for your referencing and referenced tables, you may encounter error code 1005. Make sure that the storage engines are compatible, such as using InnoDB for both tables, as some storage engines do not support foreign key constraints.</li>



<li><strong>Review MySQL error logs: </strong>Check the MySQL error logs for any additional information on the cause of the error. The error logs may provide more detailed information about the specific issue that is causing error code 1005.</li>
</ol>



<p>By following these steps, you should be able to identify and fix the issue that is causing MySQL error code 1005. If you are still encountering issues, it may be helpful to consult the MySQL documentation or seek assistance from a knowledgeable database administrator.</p>



<p><strong><em>Read More articles:</em></strong></p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/sql/fix-sql-error-1064/" target="_blank" rel="noreferrer noopener">How to fix SQL Error 1064: You have an error in your SQL syntax</a></li>



<li><a href="https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/" target="_blank" rel="noreferrer noopener">How to Fix SQL Server Error 207 – Invalid Column Name</a></li>
</ul>
<p>The post <a href="https://techyaz.com/mysql/how-to-fix-sql-error-1005-a-comprehensive-guide/">How to Fix SQL Error 1005: A Comprehensive Guide</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/mysql/how-to-fix-sql-error-1005-a-comprehensive-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Fix SQL Server Error 207 &#8211; Invalid Column Name</title>
		<link>https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/</link>
					<comments>https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sun, 09 Apr 2023 08:58:34 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2789</guid>

					<description><![CDATA[<p>SQL Server is a powerful relational database management system (RDBMS) used by many organizations for managing and storing data. However, like any software, SQL Server can encounter errors that can hinder its normal operation. One common error that SQL Server&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/">How to Fix SQL Server Error 207 &#8211; Invalid Column Name</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>SQL Server is a powerful relational database management system (RDBMS) used by many organizations for managing and storing data. However, like any software, SQL Server can encounter errors that can hinder its normal operation. One common error that SQL Server users may encounter is SQL error 207 &#8211; &#8220;Invalid Column Name.&#8221; </p>



<p>In this article, we will explore what this error means, its possible causes, and provide solutions to fix it.</p>



<h2 class="wp-block-heading">What is SQL Server Error 207 &#8211; Invalid Column Name?</h2>



<p>SQL Server error 207 occurs when a column name referenced in a SQL query does not exist in the specified table or view. In other words, SQL Server is unable to find a column with the name mentioned in the query, and as a result, throws the error message &#8220;Invalid Column Name.&#8221;</p>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img decoding="async" src="https://techyaz.com/wp-content/uploads/2023/04/sql-server-error-207.jpg" alt="SQL Server Error 207" class="wp-image-2790" width="327" height="200" srcset="https://techyaz.com/wp-content/uploads/2023/04/sql-server-error-207.jpg 885w, https://techyaz.com/wp-content/uploads/2023/04/sql-server-error-207-300x183.jpg 300w, https://techyaz.com/wp-content/uploads/2023/04/sql-server-error-207-768x469.jpg 768w" sizes="(max-width: 327px) 100vw, 327px" /></figure></div>


<h2 class="wp-block-heading">Possible Causes</h2>



<ol class="wp-block-list" type="1">
<li><strong>Typographical errors: </strong>One of the most common causes of error 207 is a typographical error in the SQL query. For example, misspelling a column name, using the wrong case, or forgetting to enclose the column name in square brackets, especially if the column name contains spaces or special characters.</li>



<li><strong>Missing or renamed column: </strong>Another possible cause of error 207 is that the column may have been deleted or renamed in the table or view, but the query has not been updated accordingly. If a column is dropped or renamed, any queries that reference that column will result in error 207.</li>



<li><strong>Scope and visibility of column: </strong>The visibility and scope of a column can also cause error 207. If a column is referenced in a query outside of its scope or visibility, SQL Server will not be able to find it, and the error will be thrown.</li>



<li><strong>Schema changes:</strong> Changes to the schema of a table or view, such as adding, modifying, or deleting columns, can also result in SQL error 207 if the query has not been updated to reflect the changes.</li>



<li><strong>Permissions: </strong>Another possible cause of SQL error 207 is insufficient permissions. If the user executing the query does not have the necessary permissions to access the column, SQL Server will throw the error.</li>
</ol>



<h2 class="wp-block-heading">Fix SQL Error 207</h2>



<p>Now that we understand the causes of SQL Server Error 207, let&#8217;s explore some solutions to fix this issue:</p>



<ol class="wp-block-list" type="1">
<li><strong>Double-check the column name:</strong> The first step in fixing error 207 is to double-check the column name referenced in the SQL query. Make sure it is spelled correctly, using the right case, and enclosed in square brackets if needed. Pay attention to any spaces or special characters in the column name.</li>



<li><strong>Verify column existence and visibility:</strong> Ensure that the column actually exists in the specified table or view and is visible to the user executing the query. If the column has been deleted or renamed, update the query accordingly.</li>



<li><strong>Update the query: </strong>If the error is caused by changes to the schema of a table or view, update the query to reflect the changes. For example, if a new column has been added, make sure to include it in the SELECT, INSERT, UPDATE, or DELETE statements as needed.</li>



<li><strong>Check permissions: </strong>Verify that the user executing the query has the necessary permissions to access the column. Make sure the user has SELECT, INSERT, UPDATE, or DELETE permissions on the table or view that contains the column.</li>



<li><strong>Use aliases and table qualifiers: </strong>When referencing columns in a query, it is a good practice to use aliases or table qualifiers to avoid ambiguity. For example, instead of just using &#8220;SELECT column_name FROM table_name,&#8221; use &#8220;SELECT t.column_name FROM table_name AS t&#8221; or &#8220;SELECT table_name.column_name FROM table_name.&#8221;</li>



<li><strong>Test and debug:</strong> After making any changes to the query or schema, always test and debug the query to ensure that the error has been resolved. Use SQL Server tools such as SQL</li>



<li><strong>Use Schema Prefix:</strong> If you are referencing a table or column that belongs to a specific schema, make sure to include the schema name as a prefix in your SQL query. For example, if you have a table named &#8220;Customers&#8221; in the &#8220;Sales&#8221; schema, your query should be something like &#8220;SELECT * FROM Sales.Customers&#8221; instead of just &#8220;SELECT * FROM Customers&#8221;.</li>



<li><strong>Resolve Ambiguous Column Names:</strong> If you encounter an ambiguous column name error, you need to specify which table the column belongs to in your SQL query. You can do this by prefixing the column name with the table name or alias in your query, e.g., &#8220;SELECT Orders.OrderID FROM Orders, Customers WHERE Orders.CustomerID = Customers.CustomerID&#8221; instead of just &#8220;SELECT OrderID FROM Orders, Customers WHERE CustomerID = Customers.CustomerID&#8221;.</li>



<li><strong>Check Table Existence: </strong>Ensure that the table mentioned in your SQL query actually exists in the database. If not, you may need to create the table or correct the table name in your query.</li>



<li><strong>Verify Schema Ownership:</strong> If you are referencing a table in a different schema, make sure that the schema exists and that you have the necessary permissions to access it. If not, you may need to create the schema or obtain the required permissions.</li>
</ol>



<p>We learn about fixing SQL Server Error 207 which occurs when a SQL query references a column that does not exist in the specified table or view. This error typically results from a misspelled column name or a reference to a non-existent column in a SELECT, UPDATE, or DELETE statement. When the SQL Server query processor encounters an invalid column name, it raises SQL Error 207 and prevents the execution of the query. You can prevent this issue by following the steps given in this article.</p>



<p><em>Read More articles:</em></p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/sql/fix-sql-error-1064/" target="_blank" rel="noreferrer noopener"><strong>How to fix SQL Error 1064: You have an error in your SQL syntax</strong></a></li>



<li><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-interview-questions-answers-indexes/" target="_blank" rel="noreferrer noopener"><strong>SQL Server Interview Questions &amp; Answers on Indexes</strong></a></li>
</ul>
<p>The post <a href="https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/">How to Fix SQL Server Error 207 &#8211; Invalid Column Name</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql/how-to-fix-sql-server-error-207-invalid-column-name/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Fix SQL Error 1045: Resolving Access Denied Issues</title>
		<link>https://techyaz.com/mysql/how-to-fix-sql-error-1045-resolving-access-denied-issues/</link>
					<comments>https://techyaz.com/mysql/how-to-fix-sql-error-1045-resolving-access-denied-issues/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sat, 08 Apr 2023 14:01:57 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2778</guid>

					<description><![CDATA[<p>If you are a database administrator or a developer who works with SQL databases, you may have encountered the dreaded &#8220;Error 1045: Access denied for user&#8221; at some point. This error occurs when you try to connect to a MySQL&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/mysql/how-to-fix-sql-error-1045-resolving-access-denied-issues/">How to Fix SQL Error 1045: Resolving Access Denied Issues</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you are a database administrator or a developer who works with SQL databases, you may have encountered the dreaded &#8220;<em>Error 1045: Access denied for user</em>&#8221; at some point. This error occurs when you try to connect to a MySQL or MariaDB database server and are unable to authenticate due to incorrect credentials or insufficient privileges. However, fear not! In this article, we will guide you through the process of fixing SQL Error 1045 and getting your database server up and running again.</p>



<h2 class="wp-block-heading">What is SQL Error 1045? </h2>



<p>Error 1045 is a MySQL error code that indicates a failed connection to the MySQL database server. The error message associated with SQL Error 1045 typically reads &#8220;<em>Access denied for user &#8216;username&#8217;@&#8217;localhost&#8217; (using password: YES)</em>&#8221; or &#8220;<em>Access denied for user &#8216;username&#8217;@&#8217;hostname&#8217; (using password: YES)</em>&#8220;. </p>



<p>This error occurs when a user attempts to connect to a MySQL database but does not have the proper authorization or has entered incorrect login credentials.</p>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img decoding="async" src="https://techyaz.com/wp-content/uploads/2023/04/SQL-error-1045.jpg" alt="sql error 1045" class="wp-image-2779" width="329" height="232" srcset="https://techyaz.com/wp-content/uploads/2023/04/SQL-error-1045.jpg 697w, https://techyaz.com/wp-content/uploads/2023/04/SQL-error-1045-300x211.jpg 300w" sizes="(max-width: 329px) 100vw, 329px" /></figure></div>


<h2 class="wp-block-heading">Possible Causes</h2>



<p>There are several potential causes for SQL Error 1045, including:</p>



<ol class="wp-block-list" type="1">
<li><strong>Incorrect username or password: </strong>One of the most common causes of SQL Error 1045 is entering incorrect login credentials, including the username or password. It is essential to double-check and ensure that the correct username and password are entered when connecting to the MySQL database.</li>



<li><strong>Missing or improper privileges:</strong> Another possible cause of SQL Error 1045 is the absence of the necessary privileges for the user trying to connect to the MySQL database. If the user does not have the proper privileges, they will be denied access, resulting in the error.</li>



<li><strong>Hostname or IP address mismatch:</strong> MySQL uses hostnames or IP addresses to identify which hosts are allowed to connect to the database. If the hostname or IP address specified during the connection attempt does not match the one defined in the MySQL configuration, SQL Error 1045 may occur.</li>



<li><strong>Firewall or security settings: </strong>Firewalls or security settings on the server hosting the MySQL database may block incoming connections, resulting in SQL Error 1045. It is essential to check the server&#8217;s firewall and security settings to ensure that they are configured correctly to allow MySQL connections.</li>



<li><strong>MySQL server configuration issues: </strong>Incorrect configuration settings in the MySQL server can also lead to Error 1045. For example, if the MySQL server is not configured to allow remote connections, users may encounter this error when trying to connect from a remote host.</li>
</ol>



<h2 class="wp-block-heading">Fix SQL Error 1045</h2>



<p>Fixing SQL Error 1045 requires identifying the root cause of the issue and taking appropriate steps to rectify it. Here are some common solutions to fix Error 1045:</p>



<h3 class="wp-block-heading">Verify Your Credentials</h3>



<p>The first step in resolving SQL Error 1045 is to verify that you are using the correct credentials to connect to your database server. Double-check the username and password you are using in your database connection settings or in your SQL command. Ensure that you are using the correct username and password combination that has the necessary privileges to access the database.</p>



<h3 class="wp-block-heading">Check for Typos</h3>



<p>Sometimes, a simple typo in your username or password can result in SQL Error 1045. Make sure that you have spelled your username and password correctly, paying attention to uppercase and lowercase letters. Also, check for any special characters or spaces that may have been mistakenly included in your credentials.</p>



<h3 class="wp-block-heading">Grant Sufficient Privileges</h3>



<p>If you are still unable to connect to the database and receive SQL Error 1045, it could be due to insufficient privileges for the user account you are using. To fix this, you can grant the necessary privileges to the user account. Log in to your database server as a privileged user, such as the root user, and execute the following SQL command:</p>



<pre class="wp-block-code"><code>GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost'IDENTIFIED BY 'password';</code></pre>



<p>Replace &#8216;username&#8217; with the actual username you are using to connect to the database and &#8216;password&#8217; with the actual password for that user. </p>



<p>This command grants all privileges on all databases and tables to the specified user account when connecting from the localhost. If you are connecting from a remote host, you may need to replace &#8216;localhost&#8217; with the appropriate hostname or IP address.</p>



<h3 class="wp-block-heading">Check hostname or IP address</h3>



<p>Verify that the hostname or IP address specified during the connection attempt matches the one defined in the MySQL configuration. If necessary, update the MySQL configuration to reflect the correct hostname or IP address</p>



<h3 class="wp-block-heading">Update Your Password</h3>



<p>If you recently changed the password for the user account you are using to connect to the database and forgot to update your connection settings, it could result in SQL Error 1045. In this case, you can simply update the password in your connection settings or in your SQL command to match the new password. If you are using a MySQL or MariaDB command-line client, you can update the password using the following SQL command:</p>



<pre class="wp-block-code"><code>ALTER USER 'username'@'localhost'IDENTIFIED BY 'new_password';</code></pre>



<p>Replace &#8216;username&#8217; with the actual username you are using and &#8216;new_password&#8217; with the new password you want to set.</p>



<h3 class="wp-block-heading">Check for Firewall or Network Issues</h3>



<p>Firewall or network issues can sometimes block the connection to the database server and result in Error 1045. Make sure that the port used by your database server (default is 3306 for MySQL and MariaDB) is open in your firewall and that there are no network connectivity issues between your client and the database server.</p>



<h3 class="wp-block-heading">Reinstall or Reconfigure MySQL or MariaDB</h3>



<p>If all else fails and you are still unable to fix SQL Error 1045, you may need to reinstall or reconfigure your MySQL or MariaDB server. This should be done with caution, as it may result in data loss or other unintended consequences. Before proceeding with a reinstallation or reconfiguration, make sure to backup your database and configuration files to prevent any potential data loss.</p>



<p>In conclusion, SQL Error 1045 can be a frustrating issue to encounter when trying to connect to your MySQL or MariaDB database server. However, by following above steps you can fix this issue.</p>



<p>Read More articles on SQL errors:</p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/sql/fix-sql-error-1064/" target="_blank" rel="noreferrer noopener">Fix the Most Common SQL Syntax Error: SQL Error 1064</a></li>
</ul>



<p></p>
<p>The post <a href="https://techyaz.com/mysql/how-to-fix-sql-error-1045-resolving-access-denied-issues/">How to Fix SQL Error 1045: Resolving Access Denied Issues</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/mysql/how-to-fix-sql-error-1045-resolving-access-denied-issues/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Fix SQL Server Error 18456: A Comprehensive Guide</title>
		<link>https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/</link>
					<comments>https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sat, 08 Apr 2023 13:27:20 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2773</guid>

					<description><![CDATA[<p>SQL Server, developed by Microsoft, is a popular relational database management system (RDBMS) used by millions of businesses worldwide. However, like any software, SQL Server may encounter errors, and one common error that users often encounter is SQL Server Error&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/">How to Fix SQL Server Error 18456: A Comprehensive Guide</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>SQL Server, developed by Microsoft, is a popular relational database management system (RDBMS) used by millions of businesses worldwide. However, like any software, SQL Server may encounter errors, and one common error that users often encounter is SQL Server Error 18456. This error occurs when users are unable to log in to their SQL Server instance due to authentication failure. In this article, we will delve into the details of SQL Server Error 18456 and provide a comprehensive guide on how to fix it.</p>



<p>SQL Server Error 18456, also known as the &#8220;Login failed for user&#8221; error, is a common authentication error that occurs when a user fails to log in to SQL Server. The error message associated with Error 18456 usually reads:</p>



<p><em>&#8220;Login failed for user &#8216;&lt;username>&#8217;. (Microsoft SQL Server, Error: 18456)&#8221;</em></p>



<p>The error occurs when SQL Server is unable to authenticate the user trying to connect to the SQL Server instance. There are several reasons why this error may occur, including incorrect login credentials, disabled user accounts, expired passwords, or issues with SQL Server authentication settings.</p>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" src="https://techyaz.com/wp-content/uploads/2023/04/SQL-Server-error-18456.png" alt="Fix SQL Server error 18456" class="wp-image-2774" width="342" height="212" srcset="https://techyaz.com/wp-content/uploads/2023/04/SQL-Server-error-18456.png 851w, https://techyaz.com/wp-content/uploads/2023/04/SQL-Server-error-18456-300x186.png 300w, https://techyaz.com/wp-content/uploads/2023/04/SQL-Server-error-18456-768x476.png 768w" sizes="auto, (max-width: 342px) 100vw, 342px" /></figure></div>


<h2 class="wp-block-heading">How to Fix SQL Server Error 18456?</h2>



<p>Fixing SQL Error 18456 requires identifying the root cause of the error and applying the appropriate solution. Here are some common solutions to fix SQL Error 18456:</p>



<ol class="wp-block-list" type="1">
<li><strong>Verify Login Credentials: </strong>The most basic step in fixing SQL Server Error 18456 is to verify that the login credentials, including the username and password, are correct. Make sure you are entering the correct login credentials for the SQL Server instance you are trying to connect to.</li>



<li><strong>Enable Mixed Mode Authentication: </strong>SQL Server supports two types of authentication modes &#8211; Windows Authentication mode and Mixed Mode (Windows Authentication and SQL Server Authentication) mode. If you are using SQL Server Authentication, make sure that Mixed Mode Authentication is enabled in SQL Server. You can do this through SQL Server Management Studio (SSMS) by right-clicking on the SQL Server instance, selecting Properties, and then navigating to the Security tab.</li>



<li><strong>Check User Account Status: </strong>Ensure that the user account you are trying to log in with is not disabled or locked out. If the user account is disabled or locked out, unlock or enable the account using SQL Server Management Studio or SQL Server command-line tools.</li>



<li><strong>Reset Password: </strong>If you suspect that the password for the SQL Server login is incorrect or has expired, reset the password. You can do this through SQL Server Management Studio or by using the ALTER LOGIN statement in SQL Server.</li>



<li><strong>Check SQL Server Error Logs:</strong> SQL Server logs detailed information about authentication failures in its error logs. Review the SQL Server error logs to identify any specific error messages related to Error 18456. The error logs may provide additional insights into the root cause of the issue.</li>



<li><strong>Verify SQL Server Permissions: </strong>Ensure that the user account has the necessary permissions to log in to the SQL Server instance. Check the server-level and database-level permissions for the user account and grant the appropriate permissions if necessary.</li>



<li><strong>Check Firewall Settings:</strong> If you are connecting to a remote SQL Server instance, verify that the appropriate ports are open in the firewall to allow communication between the client and the server. Check the firewall settings on both the client and server machines to ensure that they are not blocking the required ports.</li>



<li><strong>Check SQL Server Version:</strong> Error 18456 can also occur if there is a version mismatch between the SQL Server client and server components. Ensure that the SQL Server client version matches the server version to avoid compatibility issues.</li>



<li><strong>Apply SQL Server Service Packs and Cumulative Updates: </strong>Microsoft regularly releases service packs and cumulative updates for SQL Server that address known issues and provide bug fixes.</li>
</ol>



<p>You can also read the below articles to fix SQL error 18456:</p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/" target="_blank" rel="noreferrer noopener">Fix SQL Error 18456: failed to open the explicitly specified database</a></li>



<li><a href="https://techyaz.com/sql-server/troubleshooting/login-failed-user_name-microsoft-sql-server-error-18456/" target="_blank" rel="noreferrer noopener">Fix SQL Server Error 18456: Login failed for user ‘User_Name’.</a></li>



<li><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-18452-login-failed-login-from-untrusted-domain/" target="_blank" rel="noreferrer noopener">Fix Error 18452: Login failed. The login is from an untrusted domain</a></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/">How to Fix SQL Server Error 18456: A Comprehensive Guide</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to fix SQL Error 1064: You have an error in your SQL syntax</title>
		<link>https://techyaz.com/sql/fix-sql-error-1064/</link>
					<comments>https://techyaz.com/sql/fix-sql-error-1064/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sat, 08 Apr 2023 08:44:15 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2767</guid>

					<description><![CDATA[<p>Are you struggling with SQL Error 1064 while working with MySQL or other SQL statements? Don&#8217;t worry, you&#8217;re not alone! SQL Error 1064 is one of the most common errors encountered by developers and database administrators when working with MySQL&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql/fix-sql-error-1064/">How to fix SQL Error 1064: You have an error in your SQL syntax</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Are you struggling with SQL Error 1064 while working with MySQL or other SQL statements? Don&#8217;t worry, you&#8217;re not alone! SQL Error 1064 is one of the most common errors encountered by developers and database administrators when working with MySQL databases. But fear not, in this comprehensive guide, we will walk you through the process of fixing this error step-by-step, so you can get your database back up and running in no time.</p>



<h2 class="wp-block-heading">What is SQL Error 1064?</h2>



<p>SQL Error 1064 is a syntax error that occurs when you execute an SQL query with incorrect syntax. It&#8217;s a common mistake that can happen to anyone, regardless of their level of expertise in SQL or MySQL. The error message typically looks something like this:</p>



<p><em>&#8220;Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#8216;&#8230;&#8217; at line &#8230;&#8221;</em></p>



<p>Next, we will understand why we get this SQL syntax error and what steps we can take to fix or avoid it.</p>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" src="https://techyaz.com/wp-content/uploads/2023/04/fix-sql-error-1064.jpg" alt="Fix sql syntax error: SQL error 1064" class="wp-image-2770" width="324" height="218" srcset="https://techyaz.com/wp-content/uploads/2023/04/fix-sql-error-1064.jpg 781w, https://techyaz.com/wp-content/uploads/2023/04/fix-sql-error-1064-300x202.jpg 300w, https://techyaz.com/wp-content/uploads/2023/04/fix-sql-error-1064-768x516.jpg 768w" sizes="auto, (max-width: 324px) 100vw, 324px" /></figure></div>


<h2 class="wp-block-heading">Fix SQL Syntax Error 1064</h2>



<p>This error can be frustrating, but the good news is that it&#8217;s usually easy to fix once you identify the cause. Here&#8217;s how you can go about fixing SQL Error 1064:</p>



<ol class="wp-block-list" type="1">
<li><strong>Double-check your SQL query: </strong>The first step in fixing SQL Error 1064 is to thoroughly review your SQL query. Check for any typographical errors, missing or misplaced keywords, and incorrect syntax. Make sure that all the SQL statements in your query are properly terminated with semicolons, and that you have used the correct quotation marks (single or double) for string literals.</li>



<li><strong>Review reserved keywords: </strong>MySQL has reserved keywords that have special meanings in SQL queries. If you inadvertently use a reserved keyword as a column or table name in your query without properly escaping it, you may encounter SQL Error 1064. To fix this, either choose a different name for your column or table, or enclose the reserved keyword in backticks (`) to escape it.</li>



<li><strong>Check for mismatched parentheses or quotes:</strong> Another common cause of SQL Error 1064 is mismatched parentheses or quotes. Make sure that all opening and closing parentheses and quotes in your query are properly balanced. If you have multiple levels of nested parentheses, it&#8217;s easy to miss a closing parenthesis, causing a syntax error. Similarly, ensure that all quotes used in your query are properly paired, whether they are single or double quotes.</li>



<li><strong>Verify table and column names: </strong>Check that you have used the correct table and column names in your query. Make sure that the names are spelled correctly, and that they match the actual names of your database objects. If you are using aliases for table or column names, ensure that they are used consistently throughout your query.</li>



<li><strong>Validate data types and values: </strong>If you are inserting or updating data in your MySQL database, verify that you are using the correct data types and values for your columns. For example, if you are inserting a string value into a numeric column, or vice versa, you may encounter this SQL Syntax Error 1064. Make sure that the data types of your columns match the values you are trying to insert or update.</li>



<li><strong>Use a SQL editor or IDE: </strong>Working with a SQL editor or Integrated Development Environment (IDE) can greatly help in identifying syntax errors. These tools often provide syntax highlighting, code completion, and error checking features that can help you spot and fix SQL errors more easily.</li>



<li><strong>Consult the MySQL documentation: </strong>If you&#8217;re still unable to identify the cause of this SQL syntax error, consult the official SQL documentation in case you are using MySQL database. MySQL has extensive documentation that provides comprehensive information on SQL syntax, reserved keywords, data types, and other topics. You can search the documentation for specific keywords or browse through the documentation to learn more about SQL syntax and best practices</li>



<li><strong>Test your SQL query:</strong> If you are still encountering SQL error 1064, try executing your query in a controlled test environment, such as a local development server or a database sandbox, to isolate and identify the issue. You can also try breaking down your query into smaller parts and testing them individually to identify the specific portion of the query that is causing the error.</li>
</ol>



<p>If you are unable to fix the SQL error 1064 on your own, you may need to seek assistance from a database administrator (DBA) or a knowledgeable colleague who has experience with SQL queries and SQL syntax errors.</p>



<p class="has-vivid-red-color has-text-color"><strong><em>Read More articles</em></strong>:</p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/learning/prepare-for-job-interview/" target="_blank" rel="noreferrer noopener">How to Prepare for a Job Interview?</a></li>



<li><a href="https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/" target="_blank" rel="noreferrer noopener">Fix SQL Error 18456: failed to open the explicitly specified database</a></li>
</ul>
<p>The post <a href="https://techyaz.com/sql/fix-sql-error-1064/">How to fix SQL Error 1064: You have an error in your SQL syntax</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql/fix-sql-error-1064/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix SQL Error 18456: failed to open the explicitly specified database</title>
		<link>https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/</link>
					<comments>https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sat, 18 Sep 2021 10:16:39 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[HowTO]]></category>
		<category><![CDATA[SQL Server Connectivity Issue]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2747</guid>

					<description><![CDATA[<p>This article will help you fixing SQL Server Error: 18456, Severity: 14, State: 38, Reason: Failed to Open the Explicitly Specified Database. We were getting below error in our SQL Server error log for one of our login. Login Failed&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/">Fix SQL Error 18456: failed to open the explicitly specified database</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article will help you fixing SQL Server  Error: 18456, Severity: 14, State: 38, Reason: Failed to Open the Explicitly Specified Database. We were getting below error in our SQL Server error log for one of our login.</p>



<p><strong>Login Failed – Error: 18456, Severity: 14, State: 38</strong></p>



<p><strong>Reason: Failed to Open the Explicitly Specified Database</strong></p>



<h2 class="wp-block-heading">Fix Error &#8220;Failed to Open the Explicitly Specified Database&#8221;</h2>



<p>The error log is saying &#8220;<em>Failed to Open the Explicitly Specified Database</em>&#8220;, it means either your have specified wrong database in your connection string or your login does not have access to the specified database. You can validate below options to isolate this issue.</p>



<ul class="wp-block-list">
<li>Check whether you have specified correct database in your connection string or not</li>



<li>If you are using correct database then whether the login you are using to establish database connection has access to this specified database or not.</li>



<li>Correct if you find something in any of the above two options.</li>



<li>Check login properties whether it is using correct database as default database configuration or not. If correct database is defined then login has access to that database or not. I will explain about this step in below section as well.</li>



<li>You should also check whether number of connections to the database is exhausted or not. Review your maximum number of connections setting.</li>



<li>Ensure your database is not set to AUTO CLOSE setting or not inaccessible. Database should be online and healthy state to accept connections.</li>



<li>Make sure you have a trust between both machines, database server and the machine from where you are trying to connect. I would suggest you to read below article as well where i have explained various steps to troubleshoot SQL Server connection issues.</li>
</ul>



<p><strong><em>Read more articles on SQL error 18456 and connection issues:</em></strong></p>



<ul class="wp-block-list">
<li><a href="https://techyaz.com/sql-server/how-to-fix-sql-server-error-18456-a-comprehensive-guide/" target="_blank" rel="noreferrer noopener"><strong>How to Fix SQL Server Error 18456: A Comprehensive Guide</strong></a></li>



<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-53-not-open-connection-sql-server/" target="_blank" rel="noreferrer noopener">How to fix SQL Server error 53 &#8211; Not able to open database connection</a></strong></li>



<li><strong><a href="https://techyaz.com/sql-server/troubleshooting/login-failed-user_name-microsoft-sql-server-error-18456/" target="_blank" rel="noreferrer noopener">Fix SQL Server error 18456 &#8211; Login failed for user</a></strong></li>
</ul>



<p>Let&#8217;s learn how to check default database settings for a SQL Server login and a user mapping for any database to the login.</p>



<h3 class="wp-block-heading">Check Login Properties</h3>



<p>The solution to fix this issue can also come by reviewing the properties of this login. Launch its properties window and change the default database to the correct one if this setting is showing wrong database. Sometimes, we drop the databases from the SQL Server instances but never update other objects. If this login is not showing any database and it is showing blank then click at its drop-down to choose your desired database as the default database for this login. Click on Ok button to apply that change. You will stop getting this issue after making this change. </p>



<p>You can open login properties windows by right click at the identified login and then choose properties from dropdown options.</p>



<p>Sometimes, you have chosen the default database as &#8220;master&#8221; but your login doesn&#8217;t have connect permission on master database so ensure you have at least connect permission on the database which you are choosing as the default database for your login. You can click at &#8220;User Mapping&#8221; tab from left side pane of the login properties window. You will get all databases in top side of right side pane and level of access in bottom side pane. Click at your database from right side pane along with its level of permission which you want to assign. Click at Ok button to apply this change.</p>



<p>Have a look at below screenshot to understand default database of a login and from where you can access User Mapping tab to provide appropriate access to your database. Your login should have access to both databases, the one mentioned as default database for your login and the specified database in connection strings.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="//i0.wp.com/techyaz.com/wp-content/uploads/2021/09/image.png" alt="" class="wp-image-2748" width="586" height="526" srcset="https://techyaz.com/wp-content/uploads/2021/09/image.png 585w, https://techyaz.com/wp-content/uploads/2021/09/image-300x269.png 300w" sizes="auto, (max-width: 586px) 100vw, 586px" /><figcaption class="wp-element-caption">SQL Server Login properties window</figcaption></figure>



<p>You can fix SQL error &#8220;Failed to Open the Explicitly Specified Database&#8221; by following above steps. Write your feedback if you have fixed this issue by other way. I will update this article accordingly with credits.</p>
<p>The post <a href="https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/">Fix SQL Error 18456: failed to open the explicitly specified database</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/failed-to-open-the-explicitly-specified-database/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix Always ON Connection Timeout Error 35206 in SQL Server</title>
		<link>https://techyaz.com/sql-server/alwayson/always-on-connection-timeout-error-35206/</link>
					<comments>https://techyaz.com/sql-server/alwayson/always-on-connection-timeout-error-35206/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Fri, 23 Jul 2021 09:01:25 +0000</pubDate>
				<category><![CDATA[AlwaysOn]]></category>
		<category><![CDATA[connectivity Issue]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2613</guid>

					<description><![CDATA[<p>Recently, my company has migrated all critical SAP systems from on prem Linux based Oracle databases to Azure Cloud windows based SQL Server. These are very high end machines on which very large SQL Server databases are running with Alwayson&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/always-on-connection-timeout-error-35206/">Fix Always ON Connection Timeout Error 35206 in SQL Server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Recently, my company has migrated all critical SAP systems from on prem Linux based Oracle databases to Azure Cloud windows based SQL Server. These are very high end machines on which very large SQL Server databases are running with Alwayson configuration between 3 replicas. These databases are highly transactional, very large in size approximately more than 10 TB and these are configured to run critical SAP systems. Since few weeks, we have started facing very strange issue of connection timeout ( SQL error 35206 ) on one of our secondary availability replica. Below is full text of this SQL Server error 35206.</p>



<p class="has-vivid-red-color has-text-color"><em><strong>A connection timeout has occurred on a previously established connection to availability replica &#8216;manvendradbggp03&#8217; with id [availability group id]. Either a networking or a firewall issue exists or the availability replica has transitioned to the resolving role.</strong></em></p>



<p>You may also receive similar issue under different alwayson error 35201. Below error will generate while attempting to establish the connection to availability group but failed because of connection timeout error 35206. The error text of this SQL error 35201 is given below.</p>



<p class="has-vivid-red-color has-text-color"> <strong><em>A connection timeout has occurred while attempting to establish a connection to availability replica &#8216;manvendradbggp03&#8217; with id [availability group id]. Either a networking or firewall issue exists, or the endpoint address provided for the replica is not the database mirroring endpoint of the host server instance.</em></strong></p>



<p>If you are always getting above issues and unable to establish any connection to its respective availability replica then you should immediately look in to network side whether there is poor network latency, any network packet drop issue or firewall is blocking some connections or not as suggested in error code. But if you are getting this issue on intermittent basis then you should keep reading this article to understand more about alwayson error 35206.</p>



<h2 class="wp-block-heading">SQL Server Error 35206 and Error 35201 in Always on</h2>



<p>Both errors come because of connection timeout error between their respective replicas. Microsoft has categorized these errors as <a href="https://support.microsoft.com/en-us/topic/kb3213703-fix-an-always-on-secondary-replica-goes-into-a-disconnecting-state-10131118-b63a-f49f-b140-907f77774dc2" target="_blank" rel="noreferrer noopener">product issue</a> and released cumulative updates to fix them. You should also consider these cumulative updates as per your SQL Server version. These issues will be very problematic if you will not address them on time because of below reasons:</p>



<ul class="wp-block-list"><li>Availability databases will stop synchronizing. This could be a risk of potential data loss.</li><li>Log file will start growing on your primary replica. This could be a potential risk for an outage if we will not address this issue on time.</li><li>Frequent repetitive alerts for your critical systems</li></ul>



<p>You must fix this issue by applying the cumulative update to avoid above problematic scenarios. But if you already have applied these updates and are still facing these issues then i would recommend you to read below section to try out other options.</p>



<h2 class="wp-block-heading">Fix Always on Connection Timeout SQL Error 35206 </h2>



<p>Generally, this problem encounters only on high end systems where you have more than 24 cores CPU and SQL Server is highly transactional. One very simple workaround to overcome this issue is to restart SQL Server service on your secondary replica where you are getting this issue. Don&#8217;t restart SQL Server on primary replica. Restarting SQL Server on impacted availability replica will surely fix the issue for the time being. </p>



<p>Additionally, you should consider below checks to review and make changes accordingly as per your system design if you are still getting this issue on frequent basis.</p>



<h3 class="wp-block-heading">Use Default Network Packet Size</h3>



<p>Review network packet size configuration in SQL Server. Microsoft suggested to keep network packet size configuration with default value but sometime we make changes as per our need and forgot to revert these changes to their original values so i would recommend to revert this change to its default value. Read below article if you want to learn how to change network packet size configuration in SQL Server.</p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/sql-server-administration/change-network-packet-size-sql-server/" target="_blank" rel="noreferrer noopener"><strong>How to Change Network Packet Size in SQL Server?</strong></a></li></ul>



<p>You should also consider evaluating your network bandwidth and firewall settings to make sure and isolate the issue. I would suggest you to work with network engineer on this front to review network or firewall related configurations.</p>



<h3 class="wp-block-heading">Review Connection Timeout Setting</h3>



<p>Another option i would recommend you to evaluate and review the session or connection time out settings. Make sure that session timeout setting for your always on configuration must be more than or equal to 10 seconds. You can consider increasing session time out if you have slow network between your replicas. Although if you are running highly transactional databases on high end box i assume you already have good network bandwidth but nothing wrong in reviewing the settings. Read below article if you want to reconfigure or change session time out in always on availability group.</p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/alwayson/change-session-timeout-for-availability-group-replica/" target="_blank" rel="noreferrer noopener"><strong>How to Change Session Timeout in Always on Availability Group Configuration?</strong></a></li></ul>



<p>If you are running your always on availability group configuration between multi subnet environment then i would recommend you to read attached Microsoft article to fix <a href="https://docs.microsoft.com/en-us/archive/blogs/alwaysonpro/connection-timeouts-in-multi-subnet-availability-group" target="_blank" rel="noreferrer noopener">connection timeout errors in multi subnet availability groups</a>.</p>



<p><strong><em>Read More:</em></strong> </p>



<ul class="wp-block-list"><li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-error-976/" target="_blank" rel="noreferrer noopener">Fix SQL Server Error 976: Cannot connect to Secondary Replica of AlwaysON Availability Group</a></strong></li><li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-alwayson-error-35250-joining-database-secondary-replica-resulted-error/" target="_blank" rel="noreferrer noopener">SQL Server Alwayson Error 35250: Joining database on Secondary Replica resulted in an error</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/alwayson/fix-error-19471-listener-issue-that-came-during-configuring-sql-server-alwayson-availability-group/" target="_blank" rel="noreferrer noopener">Fix SQL Server Error 19471: Listener issue that came during Configuring SQL Server AlwaysOn Availability Group</a> </strong></li><li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noreferrer noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li></ul>



<p></p>
<p>The post <a href="https://techyaz.com/sql-server/alwayson/always-on-connection-timeout-error-35206/">Fix Always ON Connection Timeout Error 35206 in SQL Server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/alwayson/always-on-connection-timeout-error-35206/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to Enable Preview Features in Azure Data Studio</title>
		<link>https://techyaz.com/cloud/azure/enable-preview-features-in-azure-data-studio/</link>
					<comments>https://techyaz.com/cloud/azure/enable-preview-features-in-azure-data-studio/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Thu, 15 Jul 2021 11:29:08 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Azure cloud]]></category>
		<category><![CDATA[Azure Data Studio]]></category>
		<category><![CDATA[cloud]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2556</guid>

					<description><![CDATA[<p>Microsoft always releases new features and enhancements as part of preview features in Azure Data Studio before making it publicly available for general use. Users can go ahead and check these features, give their feedback to Microsoft and based on&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/cloud/azure/enable-preview-features-in-azure-data-studio/">How to Enable Preview Features in Azure Data Studio</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Microsoft always releases new features and enhancements as part of preview features in Azure Data Studio before making it publicly available for general use. Users can go ahead and check these features, give their feedback to Microsoft and based on these feedbacks Microsoft makes changes or release that feature under General Availability. Users can only use them if preview features will be enabled in Azure Data Studio. I will explain how to enable preview features in Azure Data Studio in this article.</p>



<p><a href="https://docs.microsoft.com/en-us/sql/azure-data-studio/download-azure-data-studio?view=sql-server-ver15" target="_blank" rel="noreferrer noopener">Azure Data Studio</a> is cross-platform database management tool to manage on prem as well as cloud based SQL Server deployments on windows, Linux and MacOS platforms. This tool offers a modern editor experience with IntelliSense, code snippets, source control integration, and an integrated terminal.</p>



<p>When you launch Azure Data Studio first time, it will show you a popup window and ask you to enable the preview features. You can choose &#8220;Yes&#8221; to use preview features and &#8220;No&#8221; to disable this feature. If this settings is disabled in your Azure Data studio then you can enable it anytime by accessing settings tab given bottom left of the Azure Data Studio screen. Below is the list of preview features for SQL Server in Azure Data Studio.</p>



<ul class="wp-block-list"><li>Azure portal integration</li><li>SQL Server Backup and Restore</li><li>Deployments of SQL Edge, SQL Server Big Data Cluster, SQL Server container image &amp; SQL Server on Windows</li><li>SQLCMD mode</li><li>Admin Pack for SQL Server</li><li>Azure Synapse Analytics Insights</li><li>Central Management Servers</li><li>Database Administration Tool Extensions for Windows</li><li>Kusto</li><li>Language packs</li><li>PostgreSQL</li><li>PowerShell</li><li>Query History</li><li>SandDance for Azure Data Studio</li><li>Server Reports</li><li>SQL Assessment</li><li>SQL Server Agent</li><li>SQL Server Profiler</li><li>Machine Learning</li><li>Managed Instance Dashboard</li><li>Visual Studio IntelliCode</li><li>whoisactive</li></ul>



<p>Above list is not limited to only given features. I was restoring a database using Azure Data Studio. When i tried to click at restore button, another popup window came and suggested to enable preview features for this restore as shown in below image. When you try to preform any above activity in Azure Data studio, you will get similar popup window.  </p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1018" height="320" src="//i0.wp.com/techyaz.com/wp-content/uploads/2021/07/PreviewFeature1.jpg" alt="Preview Features in Azure Data Studio" class="wp-image-2586" srcset="https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature1.jpg 1018w, https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature1-300x94.jpg 300w, https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature1-768x241.jpg 768w" sizes="auto, (max-width: 1018px) 100vw, 1018px" /></figure>



<p>I will show you step by step process to enable or disable preview feature in Azure Data Studio.</p>



<h2 class="wp-block-heading">Enable Preview Features</h2>



<p>I was trying to perform a database restore using Azure Data Studio and got a popup which was saying &#8221; You must enable preview features in order to use restore &#8220;.  Follow below steps to get it done.</p>



<ul class="wp-block-list"><li>Launch Azure Data Studio</li><li>Click at the setting button given bottom left of the screen, then again click at the setting options from displayed menu.</li></ul>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="503" height="707" src="//i0.wp.com/techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS2.jpg" alt="Click at Settings" class="wp-image-2587" srcset="https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS2.jpg 503w, https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS2-213x300.jpg 213w" sizes="auto, (max-width: 503px) 100vw, 503px" /></figure>



<ul class="wp-block-list"><li>Type Enable Preview Features from search bar given on the screen.</li><li>You will get few options in drop down. Click at checkbox for&nbsp;<strong>Enable unreleased preview features</strong>&nbsp;under&nbsp;<strong>Workbench: Enable Preview Features</strong>.</li></ul>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1018" height="730" src="//i0.wp.com/techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS3.jpg" alt="Click at check box to enable preview features" class="wp-image-2588" srcset="https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS3.jpg 1018w, https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS3-300x215.jpg 300w, https://techyaz.com/wp-content/uploads/2021/07/PreviewFeature-in-ADS3-768x551.jpg 768w" sizes="auto, (max-width: 1018px) 100vw, 1018px" /></figure>



<ul class="wp-block-list"><li>This change will automatically been saved in Azure Data Studio.</li></ul>



<p>Now, you are good to go ahead and use all features which are in preview as per your need.</p>



<h2 class="wp-block-heading">Disable Preview Features</h2>



<p>Disabling preview features in Azure Data Studio is similar to above steps. You just need to uncheck the checkbox which you have checked in above step. Follow below steps to get it disabled.</p>



<ul class="wp-block-list" id="block-874fb66d-f001-4a35-9850-84f9c8eb249a"><li>Launch Azure Data Studio</li><li>Click at the setting button given bottom left of the screen. You will get a list of options from which you need to click at the settings options again.</li><li>Type &#8220;Enable Preview Features&#8221; from search bar given on the screen.</li><li>You will get few options in drop down. Uncheck the checkbox for&nbsp;<strong>Enable unreleased preview features</strong></li><li>This change will automatically been saved in Azure Data Studio.</li></ul>



<p>You have learnt preview features enablement and how to disable it in Azure Data Studio.</p>



<p class="has-vivid-red-color has-text-color"><strong><em>Read More Articles:</em></strong></p>



<ul class="wp-block-list"><li><strong><a href="https://techyaz.com/cloud/cloud-security/cloud-security-how-to-secure-cloud-environment/" target="_blank" rel="noreferrer noopener">Cloud Security – How to Secure Cloud Environment?</a></strong></li><li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-interview-questions-answers-indexes/" target="_blank" rel="noreferrer noopener">SQL Server Interview Questions &amp; Answers on Indexes</a></strong></li><li><strong><a href="https://techyaz.com/learning/how-to-learn-cloud-computing/" target="_blank" rel="noreferrer noopener">How to Learn Cloud Computing?</a></strong></li><li><strong><a href="https://techyaz.com/cloud/what-is-cloud-computing/" target="_blank" rel="noreferrer noopener">What is Cloud Computing</a></strong></li></ul>
<p>The post <a href="https://techyaz.com/cloud/azure/enable-preview-features-in-azure-data-studio/">How to Enable Preview Features in Azure Data Studio</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/cloud/azure/enable-preview-features-in-azure-data-studio/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix SQL Server Error 121 &#8211; The Semaphore Timeout Period Has Expired</title>
		<link>https://techyaz.com/sql-server/fix-sql-server-error-121-semaphore-timeout-period-has-expired/</link>
					<comments>https://techyaz.com/sql-server/fix-sql-server-error-121-semaphore-timeout-period-has-expired/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Tue, 15 Jun 2021 14:15:47 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[SQL Server Connectivity Issue]]></category>
		<category><![CDATA[SQL_Error_Code]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2549</guid>

					<description><![CDATA[<p>Yesterday one of my teammate got a weird error while executing a T-SQL script. We are talking about SQL Server error 121 the semaphore timeout period has expired. Error details are showing below: A transport-level error has occured when receiving&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/fix-sql-server-error-121-semaphore-timeout-period-has-expired/">Fix SQL Server Error 121 &#8211; The Semaphore Timeout Period Has Expired</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Yesterday one of my teammate got a weird error while executing a T-SQL script. We are talking about SQL Server error 121 the semaphore timeout period has expired. Error details are showing below:</p>



<p><strong>A transport-level error has occured when receiving results from the server. (provider: TCP Provider, error: 0 &#8211; The semaphore timeout period has expired.) (Microsoft SQL Server, Error:121)</strong></p>



<p>This was an intermittent issue and when we were executing the script from other server it was not throwing any issue. I did some research on this and found out that this error came because of unstable network connectivity.</p>



<h2 class="wp-block-heading">SQL Server Error 121 The Semaphore Timeout Period Has Expired &#8211; Root Cause</h2>



<p>There are various parameters that can affect network connectivity like network adaptors, packet drop, configured packet size etc. So i would suggest first you should connect to your network team and ask them to look into this issue. If network team has not found anything then you need to check application level network configurations at your level.</p>



<p>You should ask some questions to your network resource like whether any network packet drop being observed or not, or is there any NIC card issue etc. Let&#8217;s assume you have already reached out to network team and they haven&#8217;t found anything. I would suggest you to look into below options at your level to make sure everything is in place and not misconfigured.</p>



<ul class="wp-block-list"><li>Check TCP\IP settings</li><li>Ensure you have appropriate network packet size configured in SQL Server</li><li>Make sure you have properly configured TCP Chimney Offload</li><li>Validate you don&#8217;t have Network Interface Card (NIC) driver issue, you can get it checked with your network team</li></ul>



<h2 class="wp-block-heading">Solution</h2>



<p>I have already described high level areas where you need to look in in above section. Let&#8217;s discuss them further here.</p>



<h4 class="wp-block-heading"><strong>Check TCP\IP settings</strong> </h4>



<p>You should open SQL Server configuration manager and check whether TCP configuration is properly done or not. Make sure to review all settings in SQL Server Network configuration settings. You should also read below article about this settings which causes a network error.</p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/troubleshooting/fix-sql-network-interfaces-error-28-server-doesnt-support-requested-protocol/" target="_blank" rel="noreferrer noopener"><strong>Fix: SQL Network Interfaces Error 28&nbsp;– Server doesn’t support requested protocol</strong></a></li></ul>



<h4 class="wp-block-heading"><strong>Review Network Packet Size</strong></h4>



<p>You should also review network packet size configuration in SQL Server. This could be one of the possible reason for this issue. Ideally we should not change the default value of this setting and keep it as it is until you have a specific requirement to change network packet size. Read below article to understand and learn network packet size in SQL Server and also step by step process about how to change the network packet size to your desired value.</p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/sql-server-administration/change-network-packet-size-sql-server/" target="_blank" rel="noreferrer noopener"><strong>How to Change Network Packet Size Configuration in SQL Server</strong></a></li></ul>



<h4 class="wp-block-heading"><strong>TCP Chimney Offload</strong></h4>



<p>This settings is very important if we have network related connectivity issue. <a href="https://docs.microsoft.com/en-US/troubleshoot/windows-server/networking/information-about-tcp-chimney-offload-rss-netdma-feature" target="_blank" rel="noreferrer noopener">TCP Chimney Offload</a> is a networking technology that helps transfer the workload from the CPU to a network adapter during network data transfer. It can be enabled or disabled in the following two locations:</p>



<ul class="wp-block-list"><li>The operating system</li><li>The advanced properties page of the network adapter</li></ul>



<p>TCP Chimney Offload will work only if it is enabled in both locations. By default, TCP Chimney Offload is disabled in both these locations. However, OEM installations may enable TCP Chimney Offload in the operating system, in the network adapter, or in both the operating system and the network adapter. </p>



<h4 class="wp-block-heading"><strong>Validate Network related Driver Issues</strong></h4>



<p>You should speak to your network resource and Windows OS platform resource and validate all drivers at OS layer and network layer should be up to date and they should not have any issue. Make sure to update the drivers if you found any issue any of these layer.</p>



<p>I hope you can fix your issue by following above steps mentioned in this article. Comment us how you have fixed this issue, the semaphore timeout period has expired.) (Microsoft SQL Server, Error:121)</p>



<p><strong><span style="color:#2e65d1" class="has-inline-color">Related Articles</span></strong></p>



<ul class="wp-block-list"><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-40-network-related-instance-specific-error-occurred-establishing-connection/" target="_blank" rel="noreferrer noopener">SQL Server Error 40: A network-related or instance-specific error occurred while establishing a connection to SQL Server.</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-1418-the-server-network-address-cannot-be-reached-or-does-not-exist/" target="_blank" rel="noreferrer noopener">Fix Error 1418: The server network address cannot be reached or does not exist.</a></strong></li><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-sql-network-interfaces-error-28-server-doesnt-support-requested-protocol/" target="_blank" rel="noreferrer noopener">Fix: SQL Network Interfaces Error 28&nbsp;– Server doesn’t support requested protocol</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/a-network-error-occurred-while-attempting-to-read-from-the-file/" target="_blank" rel="noreferrer noopener">SQL Server Native Client Error 50000: A network error occurred while attempting to read from the file</a></strong></li></ul>
<p>The post <a href="https://techyaz.com/sql-server/fix-sql-server-error-121-semaphore-timeout-period-has-expired/">Fix SQL Server Error 121 &#8211; The Semaphore Timeout Period Has Expired</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/fix-sql-server-error-121-semaphore-timeout-period-has-expired/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Change Authentication Mode in SQL Server?</title>
		<link>https://techyaz.com/sql-server/change-authentication-mode-in-sql-server/</link>
					<comments>https://techyaz.com/sql-server/change-authentication-mode-in-sql-server/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Mon, 14 Jun 2021 16:24:20 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server Connectivity Issue]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2539</guid>

					<description><![CDATA[<p>Authentication is a process to establish a successful connection. SQL Server provides two types of authentication modes to connect to their database instances. Authentication Mode is configured while installing SQL Server instance. We can also change SQL Server authentication mode&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/change-authentication-mode-in-sql-server/">How to Change Authentication Mode in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Authentication is a process to establish a successful connection. SQL Server provides two types of authentication modes to connect to their database instances. Authentication Mode is configured while installing SQL Server instance. We can also change SQL Server authentication mode later post installation. Below are two types of authentication modes in SQL Server.</p>



<ul class="wp-block-list"><li>Mixed Mode ( Windows +SQL Server login )</li><li>Windows Mode (Only Windows)</li></ul>



<p>Mixed mode provides two ways to establish database connections. One is using SQL Server logins at SQL Server layer and another one is using Windows domain user authenticated using active directory and whose login is created and mapped on SQL Server instance.</p>



<p>Windows Mode has only one way to establish database connections and that is using windows domain accounts. We must map windows accounts on SQL Server first before making any database connections. This mode doesn&#8217;t provide access to SQL Server logins. </p>



<p class="has-text-color has-vivid-red-color"><strong>Read More to Grow:</strong></p>



<ul class="wp-block-list"><li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-interview-questions-answers-indexes/" target="_blank" rel="noreferrer noopener">SQL Server Interview Questions &amp; Answers on Indexes</a></strong></li><li><strong><a href="https://techyaz.com/learning/prepare-for-job-interview/" target="_blank" rel="noreferrer noopener">How to Prepare for a Job Interview?</a></strong></li><li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noreferrer noopener">SQL Server Alwayson Interview Questions &amp; Answers</a></strong></li><li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/replication-qa-part-1/">SQL Server Replication Interview Questions &amp; Answers</a></strong></li></ul>



<h2 class="wp-block-heading">Why Windows Authentication Mode is More Secure in SQL Server?</h2>



<p>Windows mode is secure than Mixed mode authentication because mixed mode has SQL Server authentication which cannot use Kerberos security protocol. Windows account needs to be authenticated to domain active directory every time you establish a database connection. Also, Windows provides additional password policies that are not available for SQL Server logins and that is why Microsoft always recommends to use Windows authentication mode wherever it&#8217;s possible.</p>



<p>One more risk with Mixed mode is the encrypted SQL Server Authentication login password must be passed over the network at the time of the connection. Some applications that connect automatically will store the password at the client. These are additional attack points. </p>



<h2 class="wp-block-heading">Change Authentication Mode in SQL Server</h2>



<p>You can configure authentication mode in SQL Server during installing it to your system. SQL Server installation windows will allow you to choose any one of above given authentication modes. If you will choose mixed authentication mode then you need to provide sa password as per windows password policy. You can also change existing authentication mode setting to another one as per your business need.</p>



<p>Let&#8217;s assume you have installed SQL Server with Mixed authentication mode and now you have to change it to Windows Authentication mode. This section will explain step by step process to change SQL Server authentication mode.</p>



<p>We can set or change authentication mode in SQL Server either using SQL Server management studio or using T-SQL statements. </p>



<h3 class="wp-block-heading"><strong>Using SQL Server Management Studio</strong></h3>



<ol class="wp-block-list"><li>Launch SQL Server Management Studio, connect to your target SQL Server instance.</li><li>In SQL Server Management Studio Object Explorer, right-click the server, and then click&nbsp;<strong>Properties</strong>.</li><li>On the&nbsp;<strong>Security</strong>&nbsp;page, under&nbsp;<strong>Server authentication</strong>, you can see both authentication modes. Select any as per your need and then click&nbsp;<strong>OK</strong>.</li><li>This change will require SQL Server service restart. A popup window will appear to ask you to restart the service when you will click at OK button in above step. </li><li>In Object Explorer, right-click your server, and then click&nbsp;<strong>Restart</strong>. If SQL Server Agent is running, it must also be restarted.</li></ol>



<p>You have changed your authentication mode from Mixed mode to Windows using SQL Server Management Studio. </p>



<p>If you are changing authentication mode from Windows to Mixed mode then make sure to enable SQL Server login sa account. This account gets disabled during windows authentication mode to secure your SQL Server instance as sa is generic SQL Server login as it can be targeted by hackers to access your instance. Below are the steps to enable this account:</p>



<ol class="wp-block-list"><li>In Object Explorer, expand&nbsp;<strong>Security</strong>, expand Logins, right-click&nbsp;<strong>sa</strong>, and then click&nbsp;<strong>Properties</strong>.</li><li>On the&nbsp;<strong>General</strong>&nbsp;page, you might have to create and confirm a password for the&nbsp;<strong>sa</strong>&nbsp;login.</li><li>On the&nbsp;<strong>Status</strong>&nbsp;page, in the&nbsp;<strong>Login</strong>&nbsp;section, click&nbsp;<strong>Enabled</strong>, and then click&nbsp;<strong>OK</strong>.</li></ol>



<h3 class="wp-block-heading"><strong>Using T-SQL Statement</strong></h3>



<p>Microsoft has provided an extended stored procedure to chnage authenication mode in SQL Server using T-SQL statement. This extended stored procedure chnages windows registry entries so be careful while changing authentication mode in SQL Server using T-SQL statements. Make sure to take a backup of windows registry before executing this script.</p>



<p><code><strong>USE [master]<br>GO<br>EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE',<br>N'Software\Microsoft\MSSQLServer\MSSQLServer',<br>N'LoginMode', REG_DWORD, 1<br>GO</strong></code></p>



<p>Above command has again changed authenticating mode from mixed to windows.</p>



<p>If you are doing other way around then make sure to enable sa login as i suggested above. You can also use below T-SQL statement to enable sa account.</p>



<p><code><strong>ALTER LOGIN sa ENABLE ;<br>GO<br>ALTER LOGIN sa WITH PASSWORD = 'STRONG-PASSWORD' ;<br>GO</strong></code></p>



<p>Here, i have explained how to change SQL Server authentication mode from Windows to Mixed mode or vice versa. Please comment us if you have any feedback on this article.</p>



<p class="has-text-color has-vivid-red-color"><strong>Related Articles:</strong></p>



<ul class="wp-block-list"><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/login-failed-user_name-microsoft-sql-server-error-18456/" target="_blank" rel="noreferrer noopener">Fix SQL Server Error 18456: Login failed for user ‘User_Name’.</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/change-sql-server-instance-name/" target="_blank" rel="noreferrer noopener">How to Change SQL Server Instance Name?</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/t-sql/create-logon-trigger-restrict-sysadmin-logins-connect-sql-server-given-time-interval/" target="_blank" rel="noreferrer noopener">Create a Logon Trigger to Restrict sysadmin logins to connect to SQL Server for given Time Interval</a> </strong></li><li><strong><a href="https://techyaz.com/sql-server/troubleshooting/fix-error-18452-login-failed-login-from-untrusted-domain/" target="_blank" rel="noreferrer noopener">Fix Error 18452: Login failed. The login is from an untrusted domain</a> </strong></li></ul>



<p></p>
<p>The post <a href="https://techyaz.com/sql-server/change-authentication-mode-in-sql-server/">How to Change Authentication Mode in SQL Server?</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/change-authentication-mode-in-sql-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix SQL Server Error 802: There is insufficient memory available in the buffer pool.</title>
		<link>https://techyaz.com/sql-server/fix-sql-server-error-802-insufficient-memory-in-buffer-pool/</link>
					<comments>https://techyaz.com/sql-server/fix-sql-server-error-802-insufficient-memory-in-buffer-pool/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sat, 12 Jun 2021 09:37:54 +0000</pubDate>
				<category><![CDATA[Performance Tuning]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[Memory Issues]]></category>
		<category><![CDATA[performance tuning]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2533</guid>

					<description><![CDATA[<p>We receive SQL Server error 802 when buffer pool of SQL Server instance is full and cannot grow further. Here, i will discuss about this error 802 insufficient memory available in the buffer pool in this article along with its&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/fix-sql-server-error-802-insufficient-memory-in-buffer-pool/">Fix SQL Server Error 802: There is insufficient memory available in the buffer pool.</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>We receive SQL Server error 802 when buffer pool of SQL Server instance is full and cannot grow further. Here, i will discuss about this <em>error 802 insufficient memory available in the buffer pool</em> in this article along with its possible solution to fix it. Below is the error text you might get on your SQL Server system. </p>



<p><span class="has-inline-color has-luminous-vivid-orange-color">SQLServer Error: 802, There is insufficient memory available in the buffer pool. [SQLSTATE 42000]</span></p>



<h2 class="wp-block-heading"><span style="color:#170ce9" class="has-inline-color">SQL Server Error 802 &#8211; Insufficient Memory Available in the Buffer Pool</span></h2>



<p>The main reason behind getting SQL Server error 802 is your SQL Server instance is under memory pressure and there is not enough memory available to allocate further to buffer pool or buffer pool is restricted to not use memory beyond a certain limit. This might be because of various reasons as i have stated in below section. One of the very easy and straight forward approach to fix this error is to increase more memory to SQL Server system and modify max server memory in SQL Server accordingly.</p>



<h2 class="wp-block-heading"><span style="color:#170ce9" class="has-inline-color">Analysis &amp; Solution</span></h2>



<p>I would suggest to go deeper in this issue before taking any decision to allocate more memory to the system where SQL Server is running. There could be multiple temporary reasons as well which can cause SQL Server to generate below error log:</p>



<p><em><strong>SQL Server Error: 802, There is insufficient memory available in the buffer pool. [SQLSTATE 42000]</strong></em></p>



<p>Let&#8217;s discuss this issue further and ensure to not forget below points before taking any decisions.</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<ol class="wp-block-list"><li>Check system memory utilization and see if other application (not SQL Server) is not taking enough memory. Try to fix it why a particular application is taking more memory.</li><li>Make sure you have allocated enough memory in min server memory &amp; max server memory setting. You can get these setting by executing <em><strong>sp_configure</strong></em> stored procedure. Sometimes, our server has enough memory but we missed to allocate appropriate memory to SQL Server. Rule is to allocate 80% of server memory to SQL Server under max server memory setting.</li><li>Ensure to <a href="https://techyaz.com/sql-server/enable-lock-pages-in-memory-sql-server/" target="_blank" rel="noreferrer noopener"><strong>enabled Lock Pages in memory</strong></a> on your SQL Server Instance.</li><li>Validate SQL Server version and Ensure you haven&#8217;t exceeded SQL Server edition limits. Like suppose you are running with SQL Server 2012 standard edition which allows only 64 GB of RAM support and if you have allocated more than 64GB RAM then it will not be useful. Either reduce the max server memory setting to 64 or upgrade your SQL Server to leverage bigger chunk of memory utilization. </li><li>Observe your SQL Server workload. Are you getting this error during a specific time frame or operations? Or Are you getting this error when some job or number of adhoc transactions are increased? Gather these details with the help of memory clerks and DBCC MEMORYSTATUS T-SQL statements. Tune your quires and ensure to not run ad hoc queries in large numbers because their plan is not saved in cache and they have to generate sql plan every time you execute them.</li><li>Collect Memory related counters like SQL Server: Buffer Manager, SQL Server: Memory Manager, Page Life Expectancy etc. You can read attached article to understand <a href="https://techyaz.com/sql-server/performance-tuning/top-10-performance-counters-to-identify-sql-server-memory-pressure/" target="_blank" rel="noreferrer noopener"><strong>Top 10 counters to identify memory pressure</strong></a>.</li><li>Review another sp_configure setting min memory per query.</li><li>You can try clearing cache by running below DBCC commands:<ul><li>DBCC FREESYSTEMCACHE</li><li>DBCC FREESESSIONCACHE</li><li>DBCC FREEPROCCACHE</li></ul></li></ol>



<p>If you still have memory pressure after analyzing and implementing solutions given in above section then you have only two options left and this is given below:</p>



<ol class="wp-block-list"><li>Increase Server memory and accordingly increase max server memory in sp_configure</li><li>Reduce your workload on this SQL Server Instance by offloading or segregating the transactions during off peak hours.</li></ol>
</div></div>



<p>Please comment us about your issue experience and let me know how you have fixed your issue.</p>



<p><em><strong><span class="has-inline-color has-vivid-red-color">Related Articles</span></strong></em><strong><em><span class="has-inline-color has-vivid-red-color">:</span></em></strong></p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/performance-tuning/sql-server-error-701-there-is-insufficient-system-memory-to-run-this-query/" target="_blank" rel="noreferrer noopener">How to Fix SQL Server Error 701: There is insufficient system memory to run this query</a></li><li><a href="https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/" target="_blank" rel="noreferrer noopener">Understanding Hybrid Buffer Pool in SQL Server</a></li><li><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-dba-interview-questions-answers/" target="_blank" rel="noreferrer noopener">SQL Server Interview Questions &amp; Answers</a></li></ul>
<p>The post <a href="https://techyaz.com/sql-server/fix-sql-server-error-802-insufficient-memory-in-buffer-pool/">Fix SQL Server Error 802: There is insufficient memory available in the buffer pool.</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/fix-sql-server-error-802-insufficient-memory-in-buffer-pool/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Update Statistics Best Practices</title>
		<link>https://techyaz.com/sql-server/sql-server-update-statistics-best-practices/</link>
					<comments>https://techyaz.com/sql-server/sql-server-update-statistics-best-practices/#comments</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Wed, 15 Apr 2020 15:09:58 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Database maintenance]]></category>
		<category><![CDATA[update statistucs]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2510</guid>

					<description><![CDATA[<p>Update Statistics in SQL Server is very important maintenance activity to keep database&#8217;s statistics up to date. This helps SQL Server query optimizer to generate optimum query plan and improve database performance as well. Here, i will explain the best&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/sql-server-update-statistics-best-practices/">SQL Server Update Statistics Best Practices</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Update Statistics in SQL Server is very important maintenance activity to keep database&#8217;s statistics up to date. This helps SQL Server query optimizer to generate optimum query plan and improve database performance as well. Here, i will explain the best practices to run SQL Server update statistics on very large tables or databases.</p>



<p> We should be very careful while running any of the database maintenance activities on production databases. It becomes more crucial if your database size is very very big or some critical business application is using this database. Yesterday i had similar experience in one of our SAP system. Application team had reported performance issue while accessing one of the SAP system. DBAs were involved and identified a long running query that was causing the performance issue. This long running query was executing update statistics SQL Server operation on one of the biggest table in the database.  This activity took very long time around 12 hours and never completed. Finally team has killed this transaction as advised by SAP support to improve the performance. </p>



<h2 class="wp-block-heading">Understanding Update Statistics in SQL Server</h2>



<p>SQL Server uses statistics to generate fastest query plan for any transaction so we should ensure all statistics must be up to date to get better query performance. As per MSDN <em>&#8220;Updating statistics ensures that queries compile with up-to-date statistics. However, updating statistics causes queries to recompile. We recommend not updating statistics too frequently because there is a performance tradeoff between improving query plans and the time it takes to recompile queries.&nbsp;&#8220;</em></p>



<p> Here, first i will explain one of my issue as case study and then will give you SQL update statistics best practices. There are multiple things that can lead to  longer duration of this execution, so first we should understand the issue before reaching on any conclusion.</p>



<p>After looking into SQL Server transactions, we found that SQL Server update statistics was being executed with FULLSCAN option. This was a potential reason behind taking it for longer duration. Avoid running update statistics with<strong> </strong>FULLSCAN option while running it on very big tables or databases because it scans each and every record in the table that will degrade the system performance and took more time to complete. Although, you should always rethink before making a decision to run update statistics on your database if auto update statistics has been set to ON. As it was SAP ECC database so we checked the SAP documentation as well and SAP also suggests to not run it regularly if auto update statistics is set to ON. This is SQL Server auto update statistics best practices for very large databases.</p>



<p>In some cases, if you still have to run the update stats then always Use it without mentioning FULLSCAN parameter or use sp_updatestats stored procedure. If you still need to run WITH FULLSCAN then do not run the UPDATE STATISTICS SQL Server command against the entire table. Identify the column or index statistic that needs the special treatment, and only update that one with FULLSCAN.</p>



<p>Sometimes, SQL Server update statistics command may take very long time even after following above measures. This could be because of the bug reported in <a href="https://support.microsoft.com/en-in/help/4527229/fix-update-statistics-takes-very-long-time-to-generate-maintenance-pla" target="_blank" rel="noreferrer noopener">attached link</a>. This has been fixed in below CU updates. Check your SQL Server version and apply them to fix this issue if applicable.</p>



<ul class="wp-block-list"><li><a href="https://support.microsoft.com/help/4536075">Cumulative Update 2 for SQL Server 2019</a></li><li><a href="https://support.microsoft.com/help/4527377">Cumulative Update 18 for SQL Server 2017</a></li><li><a href="https://support.microsoft.com/help/4527378">Cumulative Update 11 for SQL Server 2016 SP2</a></li></ul>



<h2 class="wp-block-heading">SQL Server Update Statistics Best Practices</h2>



<p>Below is the list of best practices i have mentioned to be considered while running update statistics in SQL Server. Have a look at them.</p>



<ol class="wp-block-list" type="1"><li>Running Update Statistics on very big tables or database can increase <a rel="noreferrer noopener" href="https://techyaz.com/sql-server/identify-disk-bottleneck-using-perfmon-counters/" target="_blank">huge IO pressure on your disk subsystem</a>. SQL Server has very good feature to keep running it in real time by setting value auto update statistics to ON. If auto update statistics is set to ON then <strong>it is strongly recommended to not run it regularly on any databases</strong>. We can run it only on those tables where this setting is set to OFF. </li><li>In some cases, if you still have to run the update stats then always <strong>Use it without mentioning FULLSCAN parameter or use sp_updatestats</strong> stored procedure. If you still need to run WITH FULLSCAN then<strong> Do not run the UPDATE STATISTICS command against the entire table</strong>. Identify the column or index statistic that needs the special treatment, and only update that one with FULLSCAN.</li><li>Always run such database maintenance activities during maintenance windows. It is not recommended to run during business hours.</li><li>If you are facing performance issue during update stats execution then you should check the possibilities of potential  bug reported in <a rel="noreferrer noopener" href="https://support.microsoft.com/en-in/help/4527229/fix-update-statistics-takes-very-long-time-to-generate-maintenance-pla" target="_blank">attached link</a>.</li><li>Never run Adhoc and manual Update stats on any of the very big tables if Auto Update Statistics is set to ON because Update stats is very costly operations in terms of heavy IO activities. It does acquire schema-stability locks so it can potentially be blocked by a DDL operation (like ALTER TABLE).</li><li>One way to find out whether you should run update stats or not is to check if your statistics are stale in the execution plans or not. If estimated rows greatly differ from your actual rows returned in execution plan then that is a good indication of potential update stats candidate.</li><li>Ask Migration team (In case recently migrated) whether they have executed rebuild index or update stats after migrating data to SQL Server as part of post upgrade activity? Ideally it is recommended to run update stats after massive data load because auto update stats does not automatically update all records.</li><li>If you’ve got tables with millions of rows, and you’ve found that statistics aren’t updating fast enough, you can consider:<ul><li>Turning on Trace Flag 2371 to make auto-update statistics run more frequently on tables with large amounts of rows.</li><li>Using a third party script to handle statistics maintenance along with your index maintenance</li></ul></li><li>One way to find out if your statistics are stale is to look at the execution plans and if you estimated rows greatly differ from your actual rows returned then that is a good indication that the interval needs to be upped. If you want to do update Statistics manually you should first know&nbsp;When Statistics are updated automatically.</li><li>If the SQL Server query optimizer requires statistics for a particular column in a table that has undergone substantial update activity since the last time the statistics were created or updated, SQL Server automatically updates the statistics by sampling the column values (by using auto update statistics).&nbsp;</li></ol>



<h2 class="wp-block-heading">Update Statistics on AlwaysON Secondary Replica</h2>



<p>Temporary statistics are an improvement added in SQL Server 2012 for read-only databases. When a database is read-only, queries can’t create statistics in the database– because those require writes. As of SQL Server 2012, temporary statistics can be created in tempdb to help optimization of queries.</p>



<p>This is incredibly useful for:</p>



<ul class="wp-block-list"><li>Readable secondaries in an AlwaysOn Availability Group</li><li>Readable logshipping secondary databases</li><li>A point in time database snapshot which is queried (whether against a database mirror or live database)</li><li>Any other read-only database that has queries run against it</li></ul>



<p>Prior to SQL Server 2012, if you use logshipping for reporting&nbsp;and the same workload does not run against the log shipping publisher, consider manually creating column level statistics. (Or upgrading SQL Server.)</p>



<p><strong><span class="has-inline-color has-vivid-red-color">Read More</span></strong>:</p>



<ul class="wp-block-list"><li><a rel="noreferrer noopener" href="https://techyaz.com/sql-server/performance-tuning/understanding-database-autogrowth-sql-server/" target="_blank">Understanding Database Autogrowth in SQL Server</a></li><li><a rel="noreferrer noopener" href="https://techyaz.com/sql-server/avoid-database-shrink-operation/" target="_blank">Understanding Database Shrink Operation</a></li><li><a rel="noreferrer noopener" href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-alwayson-interview-questions-answers/" target="_blank">SQL Server AlwaysON Interview Questions &amp; Answers</a></li></ul>



<p></p>
<p>The post <a href="https://techyaz.com/sql-server/sql-server-update-statistics-best-practices/">SQL Server Update Statistics Best Practices</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/sql-server-update-statistics-best-practices/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Understanding Hybrid Buffer Pool in SQL Server</title>
		<link>https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/</link>
					<comments>https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Sun, 30 Dec 2018 12:02:57 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[New features]]></category>
		<category><![CDATA[SQL Server 2019]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2454</guid>

					<description><![CDATA[<p>Microsoft introduces a new feature called<br />
Hybrid Buffer Pool in SQL Server 2019 CTP 2.1. Read this article to understand this feature.</p>
<p>The post <a href="https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/">Understanding Hybrid Buffer Pool in SQL Server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Microsoft introduces a new feature called Hybrid Buffer Pool in SQL Server 2019 CTP 2.1. This feature allows direct access of data pages in database files stored in persistent memory (PMEM) devices.</p>



<p>Before going ahead, you might be thinking what is Persistent Memory devices and how it is related to SQL Server. Let me first explain about persistent memory.</p>



<h4 class="wp-block-heading">What is Persistent Memory?</h4>



<p>Persistent memory generally termed as PMEM, is a solid-state high performance byte-addressable memory device that resides on the memory bus. It has many benefits over other storage devices.<br></p>



<p>The main advantages of persistent memory include: </p>



<ul class="wp-block-list"><li>It provides fast data access near real-time without any latency than flash SSDs for large data sets as well.</li><li>PMEM increases throughput more than flash storage.</li><li>Biggest benefit is its cost. It&#8217;s cheaper than DRAM. </li><li>PMEM is cacheable. This is a huge advantage over PCIe interconnect, which cannot be cached in the CPU.</li><li>It retains Data in memory after power interruption or shut off. </li></ul>



<p>Persistent memory can be used in a variety of ways to deliver lower latency for applications where you need fast data access with enormous amount of data such as IoT applications, Cyber threat analysis, financial trading etc.</p>



<h4 class="wp-block-heading">What is Hybrid Buffer Pool?</h4>



<p>In a traditional system, SQL Server caches data pages in the buffer pool. With Hybrid Buffer Pool, SQL Server skips performing a copy of the page into the DRAM-based portion of the buffer pool, and instead references the page directly on the database file that lives on a PMEM device. Access to data files in PMEM for Hybrid Buffer Pool is performed using memory-mapped I/O, also known as enlightenment.  This brings performance benefits from avoiding a copy of the page to DRAM, and from the avoidance of the I/O stack of the operating system to access the page on persistent storage.  </p>



<p>Only clean pages can be referenced directly on a PMEM device. When a page becomes dirty it is kept in DRAM, and then eventually written back to the PMEM device.</p>



<p>This feature will be available in both Windows and Linux version of SQL Server 2019.</p>



<h4 class="wp-block-heading" id="enable-hybrid-buffer-pool">How to Enable Hybrid Buffer Pool?</h4>



<p>We can enable  Hybrid Buffer Pool for SQL Server instance by enabling trace flag during SQL Server startup. As of now, the current process is, we must enable the startup trace flag 809 in order to use Hybrid Buffer Pool.</p>



<p>Microsoft suggests a best practice to keep in mind while enabling  <br>Hybrid Buffer Pool in SQL Server. We should use largest allocation size available for NTFS and ensure the device has been enabled for DAX (DirectAccess) while formatting the PMEM device on Windows.</p>



<p>I hope you liked this article. Please write your comments if you have any questions.</p>



<p class="has-text-color has-vivid-red-color"><strong><em>Read More:</em></strong></p>



<ul class="wp-block-list"><li><a href="https://techyaz.com/sql-server/10-new-features-sql-server-2017-database-engine/">SQL Server 2017 New Features</a></li><li><a href="https://techyaz.com/sql-server/t-sql/new-t-sql-functions-introduced-sql-server-2017/">New T-SQL Functions introduced in SQL Server 2017</a></li><li><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/sql-server-dba-interview-questions-answers/">SQL Server DBA Interview Questions &amp; Answers</a></li></ul>



<p></p>



<p></p>
<p>The post <a href="https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/">Understanding Hybrid Buffer Pool in SQL Server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/understanding-hybrid-buffer-pool-in-sql-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Fix:VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master&#8217;</title>
		<link>https://techyaz.com/sql-server/troubleshooting/fixview-server-state-permission-was-denied-on-object-server-database-master/</link>
					<comments>https://techyaz.com/sql-server/troubleshooting/fixview-server-state-permission-was-denied-on-object-server-database-master/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Thu, 30 Aug 2018 10:52:28 +0000</pubDate>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[logins]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SQL Server Connectivity Issue]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2435</guid>

					<description><![CDATA[<p>Yesterday, one of the app user was complaining that he is not able to execute some of the queries and facing &#8220;VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master&#8217; . (Microsoft SQL Server, Error 300) &#8221; error while&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fixview-server-state-permission-was-denied-on-object-server-database-master/">Fix:VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master&#8217;</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Yesterday, one of the app user was complaining that he is not able to execute some of the queries and facing &#8220;<em>VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master&#8217; . (Microsoft SQL Server, Error 300) &#8221; </em>error while executing the script. The screenshot of this error is given below.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2436" src="https://techyaz.com/wp-content/uploads/2018/08/1-error-300-min.jpg" alt="SQL Server Error 300" width="723" height="193" srcset="https://techyaz.com/wp-content/uploads/2018/08/1-error-300-min.jpg 723w, https://techyaz.com/wp-content/uploads/2018/08/1-error-300-min-300x80.jpg 300w" sizes="auto, (max-width: 723px) 100vw, 723px" /></p>
<h3><span style="color: #000000;">VIEW SERVER STATE Permission</span></h3>
<p>This is high level server-level privilege which must not be granted to everybody. Only administrators must have privilege to use view server state permission but we can assign this permission to some users who want to see server level state of your SQL Server instance. Once you will grant this access to any login, he can see result of all DMVs.</p>
<h2><span style="color: #000000;">Solution &#8211; ( Microsoft SQL Server, Error 300 )</span></h2>
<p>We got SQL Server error 300 ( VIEW SERVER STATE permission was denied ) because the login you are using to execute the script doesn&#8217;t have this permission. To fix this issue we will grant view server state permission to the login name. This section will explain how to grant view server state permission to a login.</p>
<h3>Grant VIEW SERVER STATE Permission</h3>
<p>We can assign this permission either using GUI in SQL Server Management Studio or we can simply execute a T-SQL command to get this done. I will explain both ways to assign this permission.</p>
<p><strong><span style="color: #993300;">Using GUI in SQL Server Management Studio</span></strong></p>
<p>Follow below steps to do it using GUI.</p>
<ol>
<li>Launch SQL Server Management Studio.</li>
<li>Connect to the SQL Server Instance.</li>
<li>Navigate to <strong>Security </strong>folder then expand<strong> Logins</strong></li>
<li>Right Click at your login name and choose <strong>Properties</strong></li>
<li>Click at <strong>Securables</strong> tab from left side pane.</li>
<li>In the bottom pane, scroll to the bottom and click at <strong>Grant</strong> option for <strong>View Server State </strong>value.</li>
<li>Now click on apply to close the window. You can now ask your user to test the script again. This time it will work.</li>
</ol>
<p><strong><span style="color: #993300;">Using T-SQL statement in SQL Server Management Studio</span></strong></p>
<ol>
<li>Launch SQL Server Management Studio. Connect to the SQL Server Instance.</li>
<li>Open <strong>New Query </strong>window</li>
<li>Run below T-SQL statement</li>
</ol>
<pre><em><strong><span style="color: #0000ff;">USE master</span></strong></em>
<em><strong><span style="color: #0000ff;">GO</span></strong></em>
<em><strong><span style="color: #0000ff;">GRANT VIEW SERVER STATE TO "LoginName"</span></strong></em></pre>
<p>Once you execute above command, you will have view server state permission on your login name. You can resolve <em><strong>SQL Server error 300</strong></em> <strong><em>VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master </em></strong>issue by following above steps given in this article.</p>
<h3>Revoke VIEW SERVER STATE Permission</h3>
<p>If you have identified anyone who must not have this permission then you can go ahead and revoke his access post getting proper approvals. Make sure that identified login does not have any business justification before revoking his access. Once you have decided to go ahead to remove view server state permission then you should run below T-SQL statement to get this done. Below steps will tell you how to revoke view server state permission of any login.</p>
<p><em><strong><span style="color: #0000ff;">USE master</span></strong></em></p>
<p><em><strong><span style="color: #0000ff;">REVOKE VIEW SERVER STATE TO &#8220;LoginName&#8221;</span></strong></em></p>
<p><em><strong><span style="color: #0000ff;">GO</span></strong></em></p>
<p>View SERVER STATE permission has been revoked for identified login post successful execution of above statement.</p>
<p>I hope you like this article. Please follow our <a href="https://www.facebook.com/Techyaz/">facebook</a> page and <a href="https://twitter.com/Tech_yaz">Twitter</a> handle to get latest updates.</p>
<p><em><span style="color: #800000;"><strong>Read More:</strong></span></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/sql-server-alwayson-interview-questions-answers/" target="_blank" rel="noopener">SQL Server AlwaysON Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/interview-questions/sql-server-dba-interview-questions-answers/" target="_blank" rel="noopener">SQL Server DBA Interview Questions &amp; Answers</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/enhanced-database-failover-in-availability-group/" target="_blank" rel="noopener">Understanding Enhanced Database Failover in Always on Availability Group</a></strong></li>
<li><strong><a href="https://techyaz.com/interview-questions/sql-server-interview-questions/replication-qa-part-1/" target="_blank" rel="noopener">SQL Server Replication Interview Questions &amp; Answers</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/troubleshooting/fixview-server-state-permission-was-denied-on-object-server-database-master/">Fix:VIEW SERVER STATE permission was denied on object &#8216;server&#8217;, database &#8216;master&#8217;</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/troubleshooting/fixview-server-state-permission-was-denied-on-object-server-database-master/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Error 5184: Cannot use file &#8216;I:\Path\Techyaz.mdf’ for clustered server</title>
		<link>https://techyaz.com/sql-server/clustering/error-5184-level-16-state-2-line-1-cannot-use-file-for-clustered-server/</link>
					<comments>https://techyaz.com/sql-server/clustering/error-5184-level-16-state-2-line-1-cannot-use-file-for-clustered-server/#respond</comments>
		
		<dc:creator><![CDATA[Manvendra Deo Singh]]></dc:creator>
		<pubDate>Wed, 29 Aug 2018 12:10:18 +0000</pubDate>
				<category><![CDATA[Clustering]]></category>
		<category><![CDATA[SQL Server Connectivity Issue]]></category>
		<guid isPermaLink="false">https://techyaz.com/?p=2425</guid>

					<description><![CDATA[<p>Today, one of my team mate was trying to attach a database on one of the clustered SQL Server instance. He got error 5184 while attaching the database. The details about error 5184 is given below. Msg 5184, Level 16,&#46;&#46;&#46;</p>
<p>The post <a href="https://techyaz.com/sql-server/clustering/error-5184-level-16-state-2-line-1-cannot-use-file-for-clustered-server/">SQL Server Error 5184: Cannot use file &#8216;I:\Path\Techyaz.mdf’ for clustered server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Today, one of my team mate was trying to attach a database on one of the clustered SQL Server instance. He got error 5184 while attaching the database. The details about error 5184 is given below.</p>
<p><em><span style="color: #ff0000;">Msg 5184, Level 16, State 2, Line 1</span></em><br />
<em><span style="color: #ff0000;">Cannot use file ‘I:\Path\Techyaz.mdf’ for clustered server. </span></em><br />
<em><span style="color: #ff0000;">Only formatted files on which the cluster resource of the server has a dependency can be used. </span></em><em><span style="color: #ff0000;">Either the disk resource containing the file is not present in the cluster group or the cluster resource of the Sql Server does not have a dependency on it.</span></em></p>
<p><em><span style="color: #ff0000;">Msg 1802, Level 16, State 1, Line 1</span></em><br />
<em><span style="color: #ff0000;">CREATE DATABASE failed. Some file names listed could not be created. Check related errors.</span></em></p>
<p>While troubleshooting this error we came to know that the storage or LUN on which we have placed the database files are not added to cluster group. It means disk is not visible in failover cluster manager.</p>
<h3><span style="color: #333399;">Solution &#8211; Error 5184</span></h3>
<p>We performed below steps to fix this issue.</p>
<ol>
<li>Added the storage on which databases files are placed as shared storage in the failover cluster manager.</li>
<li>Launch SQL Server properties window in Failover Cluster Manager.</li>
<li>Added all newly added disks in Dependencies tab.</li>
<li>Attached the database again.</li>
</ol>
<p>Here i will explain above steps in detail with screenshots.</p>
<ul>
<li>We were attaching a database using T-SQL statement on one of the SQL Server cluster instance. While executing the command we get error 5184. Error details are given in below screenshot.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-2426" src="https://techyaz.com/wp-content/uploads/2018/08/1-Error-Msg-min-1024x178.jpg" alt="Fix SQL Server Error 5184" width="659" height="115" srcset="https://techyaz.com/wp-content/uploads/2018/08/1-Error-Msg-min-1024x178.jpg 1024w, https://techyaz.com/wp-content/uploads/2018/08/1-Error-Msg-min-300x52.jpg 300w, https://techyaz.com/wp-content/uploads/2018/08/1-Error-Msg-min-768x133.jpg 768w, https://techyaz.com/wp-content/uploads/2018/08/1-Error-Msg-min.jpg 1066w" sizes="auto, (max-width: 659px) 100vw, 659px" /></p>
<ul>
<li>As error suggests that <em>“Either the disk resource containing the file is not present in the cluster group”</em> so I checked cluster group for the disk and found that database files storage was not showing in failover cluster manager.</li>
<li>Next step was to add these storage disks to the cluster group. Launch <strong>failover cluster manager</strong>. Click at <strong>Roles</strong> tab from left side pane. You can see SQL Server as role in right side pane. Right click at the SQL Server role and click at “<strong>Add Storage</strong>” option. You can see this in below screenshot.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-2427" src="https://techyaz.com/wp-content/uploads/2018/08/2-Add-Storage-min.jpg" alt="Add Storage to Cluster group" width="514" height="329" srcset="https://techyaz.com/wp-content/uploads/2018/08/2-Add-Storage-min.jpg 589w, https://techyaz.com/wp-content/uploads/2018/08/2-Add-Storage-min-300x192.jpg 300w" sizes="auto, (max-width: 514px) 100vw, 514px" /></p>
<ul>
<li>Once you will click at “<strong>Add Storage</strong>” option you will get below window to add the identified disks to cluster group. You can see I have selected all required disks in below screenshot. You can choose your disks where your database files are placed.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-2428" src="https://techyaz.com/wp-content/uploads/2018/08/3-Add-Storage-min.jpg" alt="Add Storage to cluster group" width="680" height="511" srcset="https://techyaz.com/wp-content/uploads/2018/08/3-Add-Storage-min.jpg 815w, https://techyaz.com/wp-content/uploads/2018/08/3-Add-Storage-min-300x225.jpg 300w, https://techyaz.com/wp-content/uploads/2018/08/3-Add-Storage-min-768x577.jpg 768w" sizes="auto, (max-width: 680px) 100vw, 680px" /></p>
<ul>
<li>Once you click at OK button post selecting all respective check boxes in above step, you will see all your storage disks in failover cluster manager under storage tab.</li>
<li>Now again click at the SQL Server role and then go to “<strong>Resources</strong>” tab from down side pane where you can see SQL Server and all resources that are aligned for the SQL Server role. Here, right click at SQL Server and click at Properties tab as shown in below screenshot.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2429" src="https://techyaz.com/wp-content/uploads/2018/08/4-Add-Dependencies-min.jpg" alt="Add Disk Dependencies in FCM" width="589" height="182" srcset="https://techyaz.com/wp-content/uploads/2018/08/4-Add-Dependencies-min.jpg 589w, https://techyaz.com/wp-content/uploads/2018/08/4-Add-Dependencies-min-300x93.jpg 300w" sizes="auto, (max-width: 589px) 100vw, 589px" /></p>
<ul>
<li>Once you get SQL Server properties windows in failover cluster manager, next you should click at dependencies tab. Here, you need to insert one row for each disk system that you have added in above steps. Once you will insert dependencies for all newly added disks then it will look like below screenshot. Now click at OK button to apply this change.</li>
</ul>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2430" src="https://techyaz.com/wp-content/uploads/2018/08/5-Add-Dependencies-min.jpg" alt="Add Disk Dependencies in FCM" width="405" height="493" srcset="https://techyaz.com/wp-content/uploads/2018/08/5-Add-Dependencies-min.jpg 405w, https://techyaz.com/wp-content/uploads/2018/08/5-Add-Dependencies-min-246x300.jpg 246w" sizes="auto, (max-width: 405px) 100vw, 405px" /></p>
<ul>
<li>Now again go to SQL Server query window and run the T-SQL command to  attach the database. This time you will successfully attach the database to the clustered SQL Server instance.</li>
</ul>
<p>Let me know if this article helped you to fix your issue. You can follow our <a href="https://www.facebook.com/Techyaz/" target="_blank" rel="noopener">facebook</a> page and <a href="https://twitter.com/Tech_yaz" target="_blank" rel="noopener">Twitter</a> handle to get latest updates.</p>
<p><em><strong><span style="color: #800000;">Read More:</span></strong></em></p>
<ul>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/upgrade-or-patch-sql-server-failover-cluster-instance-with-availability-group/" target="_blank" rel="noopener">Upgrade or Patch SQL Server Failover Cluster Instance Running with Availability Group</a></strong></li>
<li><strong><a href="https://techyaz.com/sql-server/alwayson/change-failover-mode-of-availability-replica-in-always-on-availability-group/" target="_blank" rel="noopener">How to Change Failover Mode of Availability Replica in AOAG?</a></strong></li>
<li><strong><a href="https://techyaz.com/learning/prepare-for-job-interview/" target="_blank" rel="noopener">How to Prepare for a Job Interview?</a></strong></li>
<li><strong><a href="https://techyaz.com/interview-questions/sql-server-dba-interview-questions-answers/" target="_blank" rel="noopener">SQL Server DBA Interview Questions &amp; Answers</a></strong></li>
</ul>
<p>The post <a href="https://techyaz.com/sql-server/clustering/error-5184-level-16-state-2-line-1-cannot-use-file-for-clustered-server/">SQL Server Error 5184: Cannot use file &#8216;I:\Path\Techyaz.mdf’ for clustered server</a> appeared first on <a href="https://techyaz.com">Techyaz.com</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://techyaz.com/sql-server/clustering/error-5184-level-16-state-2-line-1-cannot-use-file-for-clustered-server/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
