Category Archives: SQL

Migrate an SQL database from Windows to Linux using backup-and-restore and SMB Protocol

In an attempt decouple systems, we may modularize them. In most cases, we would need to move databases from one server to another—sometimes, even move them from Windows to Linux. In the case of moving a database to Linux, SQL Server’s … Continue reading

Posted in SQL, SQL 2016, SQL Server vNext | Tagged , , , | Leave a comment

Understanding Database Backup Encryption in SQL Server

Terabytes of data, millions of rows; the entire business depends on this — a database administrator’s responsibility is as massive as it sounds. Apart from keeping the data secure, a database administrator also has to keep the system up and … Continue reading

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

SQL Server Database Recovery Process Internals – database STARTUP Command

A database recovery process is an essential requirement for database systems, It can be a tedious job and the process of recovery varies on a lot of scenarios. The desire to improve recovery results has resulted in various procedures but … Continue reading

Posted in SQL | Tagged , , | Leave a comment

Custom keyboard shortcuts in SQL Server Management Studio (SSMS)

People love taking shortcuts because it’s the easiest way to do things faster; computers are no exception. Shortcuts, particularly ones performed by keyboard, can save you hours of time once applied properly. Learning keyboard shortcut saves you a lot of … Continue reading

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

Illustration of an example availability monitoring service Using PowerShell and SQL

This article discusses a simple solution of how to monitor SQL service availability across multiple servers and reporting. To build this I’ll use SQL Server with simple PowerShell script and cmdlets which generate JSON data and displays results in HTML … Continue reading

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

SQL: Different ways to generate sequence

There was a question from the op regarding adding a new column to a query output by generating the cyclic sequence numbers from 1 to 3. Select A =identity(int,1,1),B,C from table_abs 1,A,41 2,B,13 3,C,90 4,D,91 5,E,98 6,F,12 7,G,54 8,H,16 For … Continue reading

Posted in SQL, SQL 2012, Uncategorized | Tagged , , | 2 Comments

SQL Server 2016: JSON integration

Abstract This article helps to explain the application of JSON data and the use of new SQL 2016 constructs that enable an integration of JSON data into a relational schema. The idea behind this article is to list as many … Continue reading

Posted in JSON, SQL, SQL 2016, T-SQL | Tagged , , , , , , , , | Leave a comment

SQL Server: How to backup and replace text in all search string matching Stored Procedure(s)

Table of Contents Problem Statement:- Solution:- Generate script for matching search string of all SP’s Using sp_helptext Using system view sys.procedures Generate modified SP’s script Create Linked Server Alias Conclusion References Problem Statement:- After SQL Server Migration or database rename … Continue reading

Posted in SQL | Tagged , , , | 1 Comment

SQL : How to Find Unused Indexes details

The Dynamic Management View (DMV) named sys.dm_db_index_usage_stats that track  index usage details of the database. This DMV gives an information about an index which is being updated but not used in any seeks, scan or lookup operations. The below query list … Continue reading

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

SQL Server: Monitoring Disk Space with FSUTIL command line utility

Table of Contents Introduction Pre-requisites Data flow Enable xp_cmdshell Download SQL Code Output Conclusion References See Also Introduction This article talks about one of SQL method to fetch the disk usage details and use of T-SQL in conjunction with invoking … Continue reading

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