Category Archives: SQL

SQL Database Corruption: Causes, Prevention, Fixing Techniques

“I had a Database File and I want to attach this MDF file to SQL Server 2014. However, whenever I try to attach the file, I am receiving following error message : The header for file ….\MSSQL\DATA\xxxx_data.mdf’ is not a … Continue reading

Posted in SQL | Leave a comment

Overview of SQL Server Backup Types

SQL Server backups, in itself, is a vast subject; so vast, there are multiple books written about them. In this article, however, we are going to focus on the types of backups that are available to us, and understand how … Continue reading

Posted in SQL | Tagged , , , , , , | Leave a comment

SQL Server Data Management Life Cycle

This is the second article in the “Backup and Restore (or Recovery) in SQL Server” stairway series (see the full TOC below). This article deals with the different phases of data management life cycle and it encompasses the following topics: … Continue reading

Posted in SQL | Tagged , , , , , , | Leave a comment

Experiment with SQL Server and DBFS on Linux

Given that Microsoft now considers Linux a ‘first-class citizen’, SQL Server 2017 offers native support for Linux. It is engineered to be cross-platform, and that’s good news for Linux administrators and open source developers. Microsoft’s support for Linux (and open … Continue reading

Posted in SQL | Tagged , , , | 1 Comment

Importance of Memory Setting in SQL Server

Memory is one among the resources forming the performance triangle—CPU and storage being the other two. If one is hit, the other two take the load to try to bring the performance to acceptable levels, but there’s always the trade-off. … Continue reading

Posted in SQL | Tagged , , , , | Leave a comment

An overview of SQL Server backup-and-restore process

In a manner of speaking, planning and implementing a SQL Server backup design is an art. Backup, Restoration, Recovery, Business Continuity Plans (BCP), and Disaster Recovery (DR) are different phases of data revolving around the discussions involving data backup. In … Continue reading

Posted in SQL | Tagged , , | Leave a comment

SQL Server – Internals of sp_spaceused

This article is an effort to dissect the output of the sp_spaceused stored procedure. Introduction Understanding the database usage internals and the growth trends play a vital role in the defining the right sizing of the database. sp_spaceused is probably an administrator’s … Continue reading

Posted in SQL | Tagged , , , , , , | Leave a comment

Different methods to write PowerShell output to a SQL table

PowerShell has become the ultimate choice for many database administrators because of its efficient way of handling and managing automation in a simple, quick way. It’s built on .NET Framework and uses Object Models such as COM, ADSI, ADO, and … Continue reading

Posted in PowerShell, SQL, T-SQL | Tagged , , , , , | 2 Comments

Monitoring SQL Server database status changes using T-SQL and PowerShell scripts

Monitoring a SQL Server database is a critical component of database administration. Ninety percent of the organizations expect the number of databases to increase over the next twelve months. An increase in data volumes can have negative effects on the … Continue reading

Posted in SQL, T-SQL, XML | Tagged , , , | Leave a comment

Recover Deleted Data from SQL Table Using Transaction Log and LSNs

Introduction At times a user may perform UPDATE operation or DELETE operation in SQL server database without applying the WHERE condition. This is a very common reason for encountering loss of data from SQL Server Tables. As the SQL Server … Continue reading

Posted in SQL, SQL 2016, SQL Server 2017 | Tagged , , , | 1 Comment