• Email Address: forum@outsourcepath.com
English
  • English
Resources, Articles, Tricks, and Solutions about SQL Issues and Solutions

SQL Server divide by zero error encountered - Fix it Now ?

This article covers methods to resolve resolve error 'SQL Server divide by zero error encountered'. This error is caused by performing a division operation wherein the denominator or the divisor is 0. This error is not encountered when the denominator or divisor is NULL because this will result to a NULL value.


Many client applications or drivers provide a default value of ARITHABORT is OFF.
The different values might force SQL Server to produces a different execution plan, and it might create performance issues.
You should also match the setting similar to a client application while troubleshooting the performance issues.

SQL Server Error 9002 - Fix it now

This article covers methods to resolve SQL Server Error 9002 for our customers. SQL Server Error 9002 happens when the SQL Transaction Log file becomes full or indicated the database is running out of space. A transaction log file increases until the log file utilizes all the available space in disk. A quick fix is to create more space for log file.


To Fix SQL Server Error 9002:


1. Backup Transaction Log File

Incase, SQL database that you are using is full or out of space, you should free the space. For this purpose, it is needed to create a backup of transaction log file immediately. Once the backup is created, the transaction log is truncated. If you do not take back up of log files, you can also use full or Bulk-Logged Recovery model to simple recovery model.


2. Free Disk Space

Generally, the transaction Log file is saved on the disk drive. So, you can free the disk space which contains Log file by deleting or moving other files on order to create some new space in the drive. The free space on disk will allow users to perform other task and resolve SQL Error Log 9002 The Transaction Log for Database is Full.


3. Move Log File to a Different Disk

If you are not able to free the space on a disk drive, then another option is to transfer the log file into a different disk. Make sure another disk in which you are going to transfer your log file, has enough space.

i. Execute sp_detach_db command to detach the database.

ii. Transfer the transaction log files to another disk.

iii. Now, attach the SQL database by running sp_attach_db command.


4. Enlarge Log File

If the sufficient space is available on the disk then you should increase the size of your log file. Because, the maximum size for a log file is considered as 2 TB per .ldf file.


To enlarge log file, there is an Autogrow option but if it is disabled, then you need to manually increase the log file size.

i. To increase log file size, you need to use the MODIFY FILE clause in ALTER DATABASE statement. Then define the particular SIZE and MAXSIZE.

ii. You can also add the log file to the specific SQL database. For this, use ADD FILE clause in ALTER DATABASE statement.

Then, add an additional .ldf file which allows to increase the log file.

SQL Error 17051 – Server Evaluation Edition to Enterprise Edition

This article covers method to resolve SQL Error 17051.

This SQL error  sometimes happens when the SQL Server Evaluation period has expired.

To fix Microsoft SQL Server Management Studio error:
1. Now as per the error message you open the Event Viewer and see that the Event with ID 17051, which shows SQL Server Evaluation period has expired under Details section.
2. Now, you recall that the Instance that you had installed was under Evaluation of 180 days, because you didn’t applied any Product Key. So, now how can you make it live again? All you need is a Product key of SQL Server and some clicks.
3. Open the SQL Server Installation Center and click on Maintenance link, and then click on Edition Upgrade.
4. Now on the Upgrade window Click Next and you will reach the Product Key page, apply the Key and click Next.
5. On the Select Instance page, select the SQL Instance that you want to fix and Click next. It will take some time and finally you will see a final window and click Upgrade.
6. Finally you will see the successful window, click on Close button.

Also, you can use following command line installation option to skip this specific rule to allow the upgrade process to complete successfully:
a) Open Command Prompt (CMD)
b) Go to the folder where SQL Server Setup, setup.exe file is located (like C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\SQLServer2012\)
c) Apply following command:

setup.exe /q /ACTION=editionupgrade /InstanceName=MSSQLSERVER /PID=<appropriatePid> /SkipRules= Engine_SqlEngineHealthCheck

The <appropriatePid> should be the 25 digit Key.
The above command line runs SQL Server setup in silent mode.
Now Restart the SQL Server Service for this Instance, and you will see it running fine.
Finally, go back to SSMS and now you can connect to the SQL Instance.

Microsoft SQL Server Error 916 - Fix it now

This article covers method to resolve Microsoft SQL Server Error 916 for our customers.

The main problem is due to bugs present in SQL Server Management Studio that prevents the user to connect to the database and refuses to display the database list.

How to solve Microsoft SQL server error 916:
If you receive the following error while using Microsoft SQL Server Management Studio 2008:
The server principal "username" is not able to access the database "dbname" under the current security context. (Microsoft SQL Server, Error: 916).

Causes of SQL Server Error 916:
1. The user is not permitted to view the data of selected column within the database.
2. The database is currently not available.
3. There are multiple columns such as Size, Space available, Data Space Used, Default file group, Index Space Used, Mail host, Primary file path and user has added at least one of them to the list of Object Explorer Details.
4. If the Auto Close option for the database is enabled, then Collation column cannot be retrieved by SQL Server Management Studio (SSMS).
5. For a database, Collation column contains NULL.

In order to view the granted permissions for the guest-user, the following command is helpful if run by a member of a Sysadmin fixed server.
The query is as follows:

USE msdb;
 SELECT prins.name AS grantee_name, perms.*
 FROM sys.database_permissions AS perms
 JOIN sys.database_principals AS prins
 ON perms.grantee_principal_id = prins.principal_id
 WHERE prins.name = ‘guest’ AND perms.permission_name = ‘CONNECT’;
 GO

On running the above command, a table is presented to the user containing all the attributes of guest user.
However, an empty result shows that guest user is disabled in the database and again the SQL Server error 916 will be displayed.
To overcome the error you may perform the following available solutions.

To fix this SQL server error 916:
1. In Object Explorer, click databases.
2. Display "Object Explorer Details" (F7) or "View –> Object Explorer Details".
3. Right-click the column headers and deselect "collation".
4. Refresh the databases.

SQL Error 50000 - Best method to fix

This article covers method to fix SQL Error 50000.

This SQL error happens in the process of installing SQL Server Management Studio on one of the client machines.
If you receive SQL Server 50000 error on a SQL Agent Job, you need to Quit the job reporting failure.

To fix this SQL error, you can try the following queries:
1. Enable the SQL Broker on the Site database:

USE master; 
GO 
ALTER DATABASE CM_PR1 SET ENABLE_BROKER 
GO

2. SET the Site Database as trustworthy:
USE master;

GO 
ALTER DATABASE CM_PR1 SET TRUSTWORTHY ON 
GO

3. SET the Database to honor the HONOR_BROKER_PRIORITY:

USE master; 
GO 
ALTER DATABASE CM_PR1 SET HONOR_BROKER_PRIORITY ON; 
GO

SQL Server Error 5009 – Different scenarios and fixes

This article covers how to fix SQL Server Error 5009 error which occurs while adding or removing a database file or extending the database file size.
 
To fix Microsoft SQL Server Error 5009 While Adding Database File:
1. Set the Operating system permission on the mentioned .ldf file to full permission for your login account and SQL Server service account.
2. Change the location to the path where you have enough permission to create or add database files.

SQL error 300 - Fix it Now

This article covers tips to resolve SQL error 300. The reason of the error is related with user permission on VIEW SERVER STATE. You can upgrade SQL Server Management studio with the same version like SQL Instance or higher. 


Also, To mitigate this error, give the following GRANT and the error message will disappear:

USE master
GO
GRANT VIEW SERVER STATE TO "LoginName"

SQL error 1071 - Fix it Now

This article covers methods to resolve SQL error 1071 which generally happens if the combined key is too long, and adjusting the varchar value must resolve this error.

MySQL always reserves the max amount for a UTF8 field which is 4 bytes so with 255  + 255 with your DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; 

you are over the 767 max key length limit.

You can only reduce the single varchar length or don't use a composite key.


To fix SQL error 1071:

You can also add these lines to a new conifg file in /etc/my.conf.d directory named umb4-support.cnf:

[mysqld]
innodb_large_prefix=true
innodb_file_format=barracuda
innodb_file_per_table=true

Then restart the maria db service.

Delete Data in SQL using DELETE statement - How to use it

This article covers how to Delete Data in SQL using the DELETE statement. 

The SQL DELETE Query is used to delete the existing records from a table.

You can use the WHERE clause with a DELETE query to delete the selected rows, otherwise all the records would be deleted.


In Structured Query Language, more commonly known as SQL, the DELETE statement is one of the most powerful operations available to users. 

DELETE operations irreversibly delete one or more rows of data from a database table. 

Being such a fundamental aspect of data management, it's important for SQL users to understand how the DELETE statement works.


The basic syntax of the DELETE query with the WHERE clause is as follows:

DELETE FROM table_name
WHERE [condition];

You can combine N number of conditions using AND or OR operators.


Note: Be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. 

The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted!


To Delete All Records:

It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:

DELETE FROM table_name;


DROP is used to delete a whole database or just a table. The DROP statement destroys the objects like an existing database, table, index, or view. A DROP statement in SQL removes a component from a relational database management system (RDBMS).

Checkpoint Process in SQL Server - An Insight into it

This article covers the Checkpoint process in SQL server and the four types of checkpoints available.
Checkpoints are the useful repositories of information and serve best for the recovery of SQL server databases.

Different Types of Checkpoint in #SQL:
1. Automatic Checkpoint
An automatic checkpoint is the most common type that is triggered by a background process. Server Configuration Option “Recovery Interval” is used by the SQL Server Database Engine to determine how often automatic checkpoints are issued on a given database.
2. Indirect Checkpoint
A new type of #checkpoint introduced in SQL Server 2012 is an Indirect checkpoint. Indirect checkpoint also runs in the background, but it meets user-specified target recovery time for a given database.
3. Manual Checkpoint
Manual checkpoint runs like any other Transact-SQL command. It runs to completion by default. This type of checkpoint occurs in the current database only. It is also possible to set the time frame in which you want your checkpoint completed.
4. Internal Checkpoint
The fourth type is Internal checkpoint that cannot be controlled by user.

SQL Server Memory Allocation

This article covers SQL server memory allocation best practices to follow while allocating memory.
By default, SQL Server can change its memory requirements dynamically based on available system resources.
SQL Server is designed to use all the memory on the server by default.
The reason for this is that #SQL Server cache the data in the database in #RAM so that it can access the data faster than it could if it needed to read the data from the disk every time a user needed it.
Changing SQL Server's Max Server memory is an online option – you don't need to restart SQL Server.
Though when you do make the change, you can and likely will cause data or procs to leave their caches so things could be a slight bit slower for a short while after you run it.
SQL Server will always give you better performance because the query is executed on the server.
Access on the back-end won't help because your client application will need to pull all the data from the tables, and then perform the join locally.
SQL Server has better indexing options.
'Max server memory' ensures that SQL Server buffer pool will not use more memory than specified in 'max server memory'.
So, SQL Server can use less memory than the value of 'max server memory' and other services can use the remaining memory.

You can monitor memory use at the database level as follows:
1. Launch SQL Server Management Studio and connect to a server.
2. In Object Explorer, right-click the database you want reports on.
3. In the context menu select, Reports -> Standard Reports -> Memory Usage By Memory Optimized Objects.

Perfmon Counters for memory usage

This article will guide you on how to use Perfmon Counters for memory usage. You will also learn some commonly used performance counters which can be used to identify #SQL server memory pressure.

To detect a memory leak using #Performance #Monitor, monitor these counters: The Memory/Available Bytes counter lets you view the total number of bytes of available memory. This value normally fluctuates, but if you have an application with the memory leak, it will decrease over time.

A system performance report is a part of Performance Monitor that details the status of local hardware resources, system response times, and processes on the local computer. You can use this information to identify possible causes of performance issues.

SQL performance tuning consists of making queries of a relation database run as fast as possible. 

To Check Detailed #Memory #Usage with Performance Monitor:

1. To open up Performance Monitor type: perfmon into the Run window (Windows Key + R). 

2. In the window that comes up, click the Performance Monitor under Monitoring Tools in the left pane. 

Reporting services configuration manager

This article will guide you on how to setup reporting services configuration manager. Report Manager is Web based interface that can be used to perform different tasks such as. Administer the Report Server,View the Reports and Manager the Report, and so on. You need to have the URL to access the Report Server by using Report Manager interface.

SQL Server Reporting Services (#SSRS) is a reporting #software that allows you to produce formatted reports with tables in the form of data, #graph, images, and charts. These reports are hosted on a server that can be executed any time using parameters defined by the users.

Report server items are always stored in libraries or in a folder within a library. 

When you access the SharePoint site, you see the Browse page and the Library Tools tab.

In #Reporting Services, URLs are used to access the Report Server Web service and the web portal. A test link of the URL appears on page when you define the URL so that you can immediately confirm that the settings you specified result in a valid connection.

To connect to Reporting Services Configuration Manager:

1. Click Start, then click #Programs, then click #Microsoft #SQL Server, then click Configuration Tools, and then click Report Server Configuration Manager. 

2. The Report Server Installation Instance Selection dialog box appears so that you can select the report server instance you want to configure.

Install SQL Server 2019 on Linux

This article will guide you the process to install #MSSQL Server 2019 on #CentOS 7 and Ubuntu 16.04.

SQL Server 2019 #Developer is a full-featured free edition, licensed for use as a development and test database in a non-production environment.

SQL Server 2019 allows us to integrate data from structured and unstructured data sources. 

We can now process diverse big data and relational data sources using Transact-SQL from SQL Server using PolyBase. 

We can see below PolyBase support external databases.

SQL Server Express can be used in production (beware of the limitations, like the 10GB cap), but according to this link Express is available for Linux. SQL Server Express is available to use in Production.

Starting with SQL Server 2017, SQL Server runs on Linux. It's the same SQL Server database engine, with many similar features and services regardless of your operating system. It's the same SQL Server database engine, with many similar features and services regardless of your operating system.

To run a SQL script in #Linux terminal:

1. Open Terminal and type mysql -u to Open the MySQL command line.

2. Type the path of your #mysql bin directory and press Enter.

3. Paste your #SQL file inside the bin folder of mysql server.

4. Create a #database in MySQL.

5. Use that particular database where you want to import the SQL file.

Configure and Use Microsoft SQL Server Management Studio

This article will guide you on how to setup SQL server management studio. SQL Server Management Studio is a free #Windows #application to configure, manage, and administer Microsoft SQL Server (#MSSQL). 

SSMS is available only as a 32-bit application for Windows.

To get SQL Server Management Studio:

1. Go To Start Menu>Programs>Microsoft SQL Server Tools 18> Microsoft #SSMS 18. 

2. Below 'Connect to Server' screen will appear. 

3. Server Name defaults to the name selected while installing MS SQL server. 

4. Server type: This is an option to select one out of four available MS SQL services option.

To Enable remote connections to your SQL Server:

i. Open #SQL Server Management Studio.

ii. Right-click your server's name and select Properties.

iii. Tick the checkbox Allow remote connections to this server.

iv. Select OK.

MSSQL replication setup

This article will guide you on how to setup #MSSQL replication and fix related errors. The MSSQL replication is a bit long procedure to configure replication. 

Through embedded SQL database replication technology, #SQL Server supports three types of #replication: snapshot, transactional, and merge replication.

#Snapshot replication sends the entire data set to the subscriber. 

Transactional replication only sends modifications to the data. 

Merge replication items are modified at both the publisher and subscribers. 

Heterogeneous replication allows access to other database products.

To enable replication in SQL Server:

Using SQL Server Management Studio (#SSMS)

1. On the Publication Databases page of the Publisher Properties - <Publisher> dialog box, select the Transactional and/or Merge check box for each database you want to replicate. 

2. Select Transactional to enable the database for snapshot replication.

3. Click OK.

Wildcards in SQL Server

This article will guide to use #Wildcards in #SQL server. Also you will learn how to use and escape wildcards SQL-based databases. 

To use a wildcard character within a pattern: Open your #query in Design view. In the Criteria row of the field that you want to use, type the #operator Like in front of your criteria. Replace one or more characters in the criteria with a wildcard character.

i. The wildcard is an advanced search technique that can be used to maximize your search results in library databases. 

ii. Wildcards are used in search terms to represent one or more other characters. 

iii. The two most commonly used wildcards are: An asterisk (*) may be used to specify any number of #characters.

SQL error 825 How to fix it

This article will guide you on methods to resolve SQL error 825 which indicates a major disk problem and not a SQL server problem. 

The connection to #SQL server cannot be established or is no longer usable. There can be various causes of this #error. The most common causes are that Microsoft Dynamics NAV Server has stopped or the connection to SQL #Server is not configured correctly.

To find SQL errors:

i. In SQL Server Management Studio, select Object Explorer.

ii. In Object Explorer, connect to an instance of SQL Server, and then expand that instance.

iii. Find and expand the Management section (assuming you have permissions to see it).

iv. Right-click SQL Server Logs, select View, and then choose SQL Server Log.


Every SQL Server #database has a transaction log that records all transactions and the database modifications made by each transaction. The transaction log is a critical component of the database. If there is a system failure, you will need that log to bring your database back to a consistent state.

To get SQL query history in SQL Server:

1. In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance.

2. Expand SQL Server Agent, and then expand Jobs.

3. Right-click a job, and then click View History.

4. In the Log File Viewer, view the job history.

5. To update the job history, click Refresh.

Modify MSSQL port

This article will guide you on the right steps to change the #MSSQL port using #SQL Server Configuration Manager. 

You can check TCP/IP connectivity to SQL Server by using telnet. For example, at the command prompt, type telnet 192.168. 0.0 1433 where 192.168. 0.0 is the address of the #computer that is running SQL Server and 1433 is the port it is listening on.

To specify a port in SQL Server Management Studio (#SSMS)?

1. You'll need the SQL Server Configuration Manager. 

2. Go to Sql Native Client Configuration, Select Client Protocols.

3. Right Click on #TCP / #IP and set your default port there.

Could not allocate space for object sql server error

This article will guide you on how to fix #SQl #error "Could not allocate space for object" which occurs due to insufficient space in the database. 

SQL SERVER – Msg 1105 – Could Not Allocate Space for #Object Name in Database ‘DB’ Because the ‘PRIMARY’ Filegroup is Full.

Whenever you get such error check below:

1. Check if auto growth is restricted.

2. Check if auto growth is set to a high value which would cause disk space to become full.

3. Check if disk space is low.

4. Check SQL edition because SQL #Express has a database file size limit.

Here is the command to set the growth to UNLIMITED:

[sq]USE [master] GO

ALTER DATABASE


[SQLAuthDB] MODIFY FILE (NAME = N’SQLAuthDB’, MAXSIZE = UNLIMITED)

GO[/sql]

SQL server error 1326 Steps to fix it

This article will guide you on methods to resolve SQL server error 1326 which occurs due to the IIS Service not having any rights to use the named pipe.

If the SQL server resides on a separate server from IIS, then the IUSR_machinename account needs to be validated on the Windows NT server that SQL resides on.

#SQL #SERVER – Fix : Error : 1326 Cannot connect to #Database Server Error: 40 – Could not open a connection to SQL Server.

Now if SQL Server can be connected perfectly from #local system, but cannot be connected from a remote system, in that case firewall on the server where SQL Server is installed can be issued.

Follow instructions below to fix the issue:

1. Go to control panel >> #Firewall Settings >> Add SQL Server’s Port to Exception List.

2. Now try to connect to SQL Server again. It will allow you to connect to the server successfully.

Microsoft SQL server error 18470 How to fix it

This article will guide you on the different factors that causes SQL server error: 18470 and also how to fix this #error.

In SQL Server Configuration Manager, in the left pane, click SQL Server Services. In the results pane, right-click SQL Server (#MSSQLServer) or a named instance, and then click Start, Stop, Pause, Resume, or Restart.

User gets the #Microsoft SQL Server Error: 18470. This may happen if the SA (System Administrator) user account is disabled in #SQL Server. It can be verified by trying to log in to SQL Server Management Studio (#SSMS) using the SA account. In the Login Properties screen, select Status on the left side.

To Microsoft SQL Server Error 18456:

1. Log In with Remote Desktop.

2. Run Microsoft SQL Server Management.

3. Checking the Server Authentication Mode.

4. Restart the SQL Service.

5. Checking SQL User Permissions.

6. Mapping the User to the #Database.

Executing queries from the MySQL Command Line

This article will guide you on how to run queries from the 3MySQL command line. The MySQL #Command Line Tool is a useful way to run #queries from the command line. It’s easy to run select queries and display the results in either a horizontal or vertical format, and the queries run are kept in a history file which you can navigate through. 

If you don't want to run a particular query after all you can use the c command to clear it.

The most common way to get a list of the MySQL #databases is by using the mysql client to connect to the MySQL server and run the SHOW DATABASES command. If you haven't set a password for your MySQL user you can omit the -p switch.

To Connect to a MySQL Database:

1. Click Services tab.

2. Expand the Drivers node from the Database Explorer.

3. Enter User Name and Password.

4. Click OK to accept the credentials.

5. Click OK to accept the default schema.

6. Right-click the MySQL Database #URL in the Services window.

SQLSTATE42000 syntax error or access violation

This article will guide you on methods to resolve 'sqlstate42000 #syntax error or access violation' which occurs due to wrong syntax entry or extra space or no space in the user's #SQL #query. 

The #1064 error displays any time you have an issue with your SQL syntax, and is often due to using reserved words, missing data in the database, or mistyped/obsolete commands.

As you can see there is more than one cause for the 1064 error within MySQL code. Now, you know how to correct the issues with your SQL Syntax, so your query can run successfully. This list will be updated as more specific instances are reported.

Restore a database in Alwayson Availability Group

This article will guide you on steps to restore a #database in alwayson availability group.

If you receive an #error that the database is in use, try to set the user to single user mode: USE master; GO ALTER DATABASE Database_name SET SINGLE_USER WITH ROLLBACK IMMEDIATE; Then try the restore with #recovery command again. Also, make sure you are on the latest service pack or cumulative update.

Creating a #SQL #Server AlwaysOn Availability Group.

Open SQL Server Management Studio and connect to the SQL Server instance. Expand the AlwaysOn High Availability folder in the Object Explorer. Right-click on the Availability Groups folder and select the New Availability Group Wizard.

To Restore a Database in a SQL Server AlwaysOn Availability Group:

1. Make the secondary server from which the backups were taken the primary server.

2. Remove the database to be restored from the AlwaysOn Availability Group.

3. Restore the database.

4. Add the database back into the Always Availability Group.

Configure Reporting Services in SQL Server

The article will guide you on the steps to follow to configure #reporting services after renaming the #SQL server. Also , you will learn how to rename the SQL server instance. 

To Configure #Report Server After Renaming SQL Server #Instance:

1. Go to #Database Setup page. 

2. Enter SQL Server name in Server Name and then click Connect. 

3. If Reporting Services is configured using the server name, you must update the database connection information whenever the server name is changed.

To change the service account for SQL Server Reporting Services:

i. Open Reporting Services Configuration Manager, and then connect to the instance of SQL Server Reporting Services.

ii. Click #Microsoft service Identity on the left pane.

iii. Change the account and the password in the Account text box and the Password text box, and then click Apply.

Database version or build from backup file

This article will guide you on how to determine the database #version or build from a #backup file.
To know what #SQL version a #database is:
The first is by using either Enterprise Manager or SQL Server Management Studio and right clicking on the instance name and selecting Properties. In the general section you will see information such as on the following screenshots. The "Product version" or "Version" gives you a number of the version that is installed.
In order to find the SQL Server version from a bak file:
1. Here is the output returned by the RESTORE HEADERONLY statement. Here you will see a DatabaseVersion column that contains the value.
2. That's how you find out from which version of SQL Server a given backup file came.

Improve SQL Server Bulk Data Import Performance

This article will guide you improve #bulk #data #import #performance. The BULK INSERT command is much faster than bcp or the data pump to perform text file import operations, however, the BULK INSERT statement cannot bulk copy data from #SQL Server to a data file. Use the bcp utility instead of DTS when you need to export data from the SQL Server table into a text file.
To Speed up SQL Bulk Insert with #transactions:
1. Declare the variables that store the number of desired items ( @items ), the size of the chunks( @chunk_size ) and the counter of the number of executed inserts( @counter )
2. Open the first transaction and initialize the while loop.

Steps to create SQL server alias

Steps for Deleting an alias using SQL Server Configuration Manager ?
#SQL aliases are used to give a table, or a column in a table, a temporary name. Aliases are often used to make column names more readable. An alias only exists for the duration of the query.
To find my SQL Server #alias name:
Expand SQL Native client #configuration, and you can find a subfolder Alias. By default, we do not have any alias defined for the SQL Server #instance. In the screenshot, we can see it does not see any items for the Alias. Right-click on Aliases and click on New Alias.
1. Take SQL Server Configuration Manager and go to SQL Server Native #Client Configuration, then click Aliases.
2. We can right-click the alias that we want to delete, and then click Delete.
3. A warning will pop up, we can click on Yes to remove the alias. This removes the SQL Server alias.

Orphaned users in SQL Server

This article will help you to identify #Orphaned #Windows #Logins and Groups in #SQL Server.
To Resolve an Orphaned User:
To map an orphaned user to a login which already exists in master, execute the ALTER USER #statement in the user database, specifying the login name.
ALTER USER <user_name> WITH Login = <login_name>; When you recreate a missing login, the user can access the database using the password provided.
To fix orphaned users for all databases in SQL Server:
1. Login with same name as user exists – generate ALTER LOGIN to map the user to the login.
2. No login with same name exists – generate DROP USER to delete the orphan user.
3. Orphan user is [dbo] – change the database owner to SA (or whatever SA was renamed to).

Auto shrink feature in SQL server

This article will guide you on how to enable and disable AutoShrink #database property. Basically, it is not recommended to enable the AutoShrink database property as it can cause many issues in the #SQL Server.
Auto Shrink is database property that allow SQL Server to automatically shrink database files if its value set to ON/True. Shrinking a database is not a good practice because it is very expensive operation in terms of I/O, CPU usage, locking and #transaction log generation.
Users can enable and disable database auto shrink option using SSMS and T-SQL both ways.
To turn on auto shrink in SQL Server:
1. Activating the database auto shrink by using #SSMS:
2. Enable database auto shrink using T-SQL:
3. Database >> #Reports >> Standard Reports >> Disk Usage.
4. Check free space for the database files:
5. Shrink database file:

SQL server Error 1053

This article will guide you on different methods of fixing error #1053 SQL server which occurs when attempting to pause or stop the SQL Server service in the #Windows Services Console. 

The most common cause of this error is when one of the files needed by sql server was not on a shared resource, and Sql Server, once failed to the other node, couldn't access it.

The #SQL #Server Agent error log may include a path or a file name that is not correct.

In this case, verify that the path and file name for SQLAgent.out is valid:

1. In SQL Server Enterprise Manager, expand the Management folder.

2. Right-click SQL Server Agent, and then click Properties.

3. Under Error Log, make sure that the path that is specified next to File Name is valid.

4. Make sure that the file name is SQLAGENT.out.

Last Restore Time of SQL server database

This article will guide you on how to collect #database restoration #history. The #SQL server database last restore time can be found using the system table in 'msdb'.
We get the following database #restoration history in my environment.
i. restore_date: It shows the database restoration #date.
ii. destination_database_name: We can get the destination database name using this #column.
iii. user_name: it gives user name that performed the restoration for that particular database.

Steps to deploy DACPAC with SSMS

This article will guide you on the steps to deploy DACPAC which involves registering a DAC instance by storing the DAC definition in the #msdb system database. 

A DAC is a self-contained unit of #SQL Server #database deployment that enables data-tier developers and database administrators to package SQL #Server objects into a portable artifact called a #DAC package, also known as a #DACPAC.

Microsoft SQL Server Error 701

This article will guide you on the steps to resolve #SQL Server #Memory pressure or insufficient #memory issue which can happen due to huge data load or other memory-intensive #operations that lead to a 701 #error in the SQL server.

SQL Server error 14265 How to fix

This article will guide you on the steps to fix SQL Server #error 14265 which occurs when the #SQL Server #Agent service auto restarts the SQL #Server.

SQL server error 1101

This article will guide on the steps to resolve #SQL SERVER ERROR "1101 : Could not allocate a new page for database because of insufficient #disk space in filegroup".

You can make sure there is enough Hard Disk space where #database files are stored on #server and Turn on AUTOGROW for file #groups.

Monitor MongoDB Performance

This article will guide you on some useful monitoring utilities and #database commands for #reporting #statistics about the state of a running #MongoDB instance.

The motivation of the MongoDB language is to implement a data store that provides high performance, high availability, and automatic #scaling. MongoDB is extremely simple to install and implement. MongoDB uses JSON or BSON documents to #store #data.

Types of SQL server backups

This article will guide you on the different types of SQL Server backups and how to use them to run #SQL Server #backups to safeguard our #databases from user #errors, media failure, #hardware failure, and so on.

A full database backup backs up the whole database. This includes part of the #transaction #log so that the full database can be recovered after a full database backup is restored.

SQL error 15123

This article will guide you on the steps to troubleshoot and fix #SQL server #error #15123 which occurs in the process of changing or viewing the values of any advanced server configuration option.

Steps to fix SQL Error 1069 the service did not start due to a logon failure

This article will guide you on how to fix SQL error 1069 arises when SQL Server service fails to start while restarting Microsoft SQL Server or SQL Server Agent.

SQL error Msg 5144 SQL error Msg 5145

This article will guide you on how to solve SQL error Msg 5144, SQL error Msg 5145 which happens in the process of extending the data or transaction log files or during autogrowth operation for data or log files.

SQL error 17058

This article will help you to solve SQL error 17058 which occurs due to various reasons that include insufficient privileges, corrupted log files, the issue with network policies, and permission issues.

SQL error Msg 4341

This guide will help you to fix SQL error Msg 4341 which can occurs during a database recovering process to a point in time. 

Implementing SQL Constraints within Transactions

This guide will show you how SQL is can be used to defer constraints thin a transaction. If implemented correctly, the terminated transaction does not create any data that violates a constraint available to other transactions.

An error occurred for a dependency of the feature causing the setup process for the feature to fail

This article will guide you on what to do to solve the error "An error occurred for a dependency of the feature causing the setup process for the feature to fail." in the process of installing the SQL server 2019 from a mounted ISO file.

SQL error Msg 3266

This article will help you to solve SQL error Msg 3266 which occurs when database backups job fails when the filemark in the backup device cannot be read. 

SQL error 3266

This article will guide you on how to fix SQL error 3266 which error occurs when the SQL Server detects filemark error on the backup device.

Recovering a database from suspect mode in SQL

This article will guide you through the process of repairing  a database which is in Suspect mode in SQL by performing consistency check on database in emergency mode and executing ALLOW DATA LOSS in single user mode.

Move table from one filegroup to another

This article will guide you on how to move a table to another filegroup manually, via T-SQL statements or by using a Table designer.

Steps to uninstall sql tools on RedHat Linux Server

This article will help you through the process of performing uninstalling SQL tools on RedHat Server.


MongoDB remote access configuration for Ubuntu

This article will guide you through the steps you can take to configure remote access for MongoDB on Ubuntu 18.04.

How to fix Microsoft SSMS activity monitor paused state error

SSMS activity monitor paused state error occurs when trying to access Activity Monitor in SQL Server Management Studio.

How to fix SQL Error 823

SQL Server error 823 results when there are hardware related issues with the SQL server such as disk errors power failures, or system problems.

How to fix SQL Server Error 824

SQL Server Error 824  is a logical Input/Output (I/O) error which affects database and makes it to be damaged or corrupted.

Solve microsoft SQL server error 15173

Microsoft SQL Server Error 15173 occurs when a login fails to drop from a SQL server instance.

How to fix SQL Server Error 5172

SQL Server Error 5172 can be triggered when trying to attach an MDF or LDF database file on the machine.

Solve SQL error 926

When a recovery process fails it makes the
SQL database to assume an inconsistent transactional state leading to Microsoft SQL server error 926.

How to fix SQL server error 15150

When trying to update a login from dbo to some other login due to permissions issues with the database, an SQL server error 15150 occurs.

How to Audit failed logins in sql server

To analyze events which happened in an SQL Server,  Auditing failed logins is very important.

Solve SQL error 15174

Here is a complete guide to fix Microsoft SQL error 15174 by following 3 steps. This error is seen while trying to drop a Login in SQL.

Solve SQL Server error 15170

Method to fix SQL Server error 15170 via T-SQL command or SSMS.

Solve SQL server error 7416

Most sql users discover that the logins which they used before suddenly develops server error 7416.

Solve SQL Server Error 15434

Microsoft SQL server users usually experience SQL Server Error 15434 in the process of removing an SQL Server login.

Fix SQL error 15138

SQL error 15138 occurs when trying to drop an orphaned user from an obsolete login.

Fix MySQL error code 1054

MySQL error code 1054 occurs when you forget to add single quotes while inserting a varchar value or due to any missing column.

Errors in the database of a website can be very frustrating especially if you have got a high traffic website and it leads to loss of customers and money as your they will turn away from your site since this type of errors affects the whole website in general.

Fix SQL server error 772

SQL server error 772 occurs when an outdated version of ODBC drivers is used and in other cases the client might be using Forced protocol Encryption.

Easy fix to SQL error 5023

From time to time, we do receive SQL related server bugs queries of which one of it was "SQL error 5023".

This SQL error is very catastrophic and it tends to disrupt the SQL server when it is trying to start up.


To fix SQL Server Error 1225:

1. Click WindowsKey + R and enter services. msc.

2. Once Services opens scroll down and locate service SQL Server.

3. Highlight the service and click START.

4. Wait for the service to start and retry to connect to your MSSQL instance.

Recent Post