SQL Server Native Client Error 50000: A network error occurred while attempting to read from the file

Error encountered

While installing SQL Server Management Studio on one of the client machines, SQL Server Native Client Error 50000 occurred. This error code was described as “A network error occurred while attempting to read from the file.”

Description of Error

Here, I will describe and explain SQL Server Error 50000 and how to fix it so that SQL Server installation goes smoothly. Before I explain SQL native client error 50000, I’d like to explain what SQL Server native client is. According to MSDN, “SQL Server Native Client” is a term that has been used interchangeably to refer to SQL Server ODBC and OLE DB drivers. SQL Server Native Client … Read the rest

SQL Server errors: The Primary Filegroup is full

SQL Server errors: The Primary Filegroup is full

“sql server error 1105 the ‘primary’ filegroup is full”  or ” Event ID: 1105 MSSQL$SQLEXPRESS – primary filegroup is full.”  error fix is provided in the article.

primary filegroup is full sql server 2014 , needs Primary group to be extended because the ‘primary’ filegroup is full sql server 2014 is error when primary group does not have any additional space for storing data or maximum file size is reached
The error sql server database error ‘primary’ filegroup is full is more common in SQL Express editions as it has maximum size limit.
The DBA’s always need to keep track of the database growth. Also, they must do the capacity planning … Read the rest

How to Resolve SQL Server Error 5172 – Fix SQL Server Header Error 5172

How to Resolve SQL Server Error 5172 – Fix SQL Server Header Error 5172

SQL Server stores its physical data in the primary database file, which contains the data by pages which store data. The header information of a .mdf file is stored by the first page, called a header page. This page contains the important information of this database file like file size, signature etc…. When a user attempts to attach the MDF / LDF database file stored on their system, a message box appears “The header for the “databasename.mdf” is not a valid database file header. The FILE SIZE property is incorrect. (SQL Server error 5172). It occurs when the header information of a .mdf file becomes corrupted.

Read the rest

how to create a subroutine in a stored procedure in SQL Server?

How to create a subroutine in a stored procedure in SQL Server?

You would seen procedures in Oracle that will call a subroutine within the same procedures for 50 times in different lines in the procedure. Now how do you recreate the same procedure in SQL Server?

Explanation below:

In SQL Server procedure, If subroutine is performing data modifications or need to use temporary tables(#teporary_table) it needs to be stored procedure. In other cases, you can use create a function. You can choose from different types of functions depending on their complexity and return values:

Simple Stored procedure will look like

DECLARE @Input INT
DECLARE @Result INT

//Some other SQL statements here...

EXEC myStoredProcedure @Input, @Result OUT

  1. Scalar function –
Read the rest

SQL Server Error : 15138, Severity: 16. The database principal owns a %S_MSG in

SQL Server Error : 15138 Details

SQL Server Error: 15138 Severity: 16 Event Logged or not: No Description: The database principal owns a %S_MSG in the database, and cannot be dropped. Severity 16 Description: Indicates general errors that can be corrected by the user.

Drop failed for User ‘VBR’.
The database principal owns a schema in the database, and cannot be dropped. (Microsoft SQL Server, Error:15138)

Cause for SQL Server Error 15138

Because the error clearly states that this user has a schema in the database, we should investigate the schema that this user owns. To check the owned schema for a user in the database, please follow the steps below.

In SSMS, connect to a SQL Server instance.

Expand … Read the rest

SQL Server Error : 108, Severity: 15. The ORDER BY position number %ld is out

SQL Server Error : 108 Details

SQL Server Error: 108 Severity: 15 Event Logged or not: No Description: The ORDER BY position number %ld is out of range of the number of items in the select list. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go
Read the rest

SQL Server Error : 107, Severity: 15. The column prefix ‘%.*ls’ does not match

SQL Server Error : 107 Details

SQL Server Error: 107 Severity: 15 Event Logged or not: No Description: The column prefix ‘%.*ls’ does not match with a table name or alias name used in the query. Severity 15 Description: Indicates syntax errors in the Transact-SQL command.

Reading sql server error log location from SQL Query

Identifying SQL Server Error Log File used by SQL Server Database Engine can be done by reading SQL Server Error Logs. DBA can execute the XP_READERRORLOG extended stored procedure to read the SQL Server Error Log and search for its location used by the instance of SQL Server.

USE master
Go
xp_readerrorlog 0, 1, N'Logging SQL Server messages in file', NULL, NULL, N'asc'
Go

The … Read the rest

SQL Server Database mirroring modes and patner timeout

The Two modes of Database Mirroring in SQL Server for HA/DR Solutions are

  1. Synchronous mirroring( High Availability / HA )
  2. Asynchronous mirroring( Disaster Recovery / DR )

Synchronous mirroring :

In all SQL Server databases, data changes are recorded in the transaction log before any changes to actual data pages are made. The transaction log records are placed first in a database’s log buffer in memory, and then flushed to disk (or ‘hardened’) as quickly as possible. In database mirroring, as the principal server writes the principal database’s log buffer to disk, it simultaneously sends that block of log records to the mirror instance.The mirror receives the log records in mirror database’s log buffer and then hardens them to disk … Read the rest