Category Archives: T-SQL

SQL Server 2017 DMVs and DMFs for DBAs

Dynamic management views (DMVs) and dynamic management functions (DMFs) are system views and system functions that return metadata of the system state. On querying the related system objects, database administrators can understand the internals of SQL Server. It allows us to … Continue reading

Posted in SQL 2017, T-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

SQL Server DB Migration – Cloning a database to another collation

Database migration is a vital task in any environment, complex or otherwise. Seamless migrations are the goal but the efforts required to ensure it are tremendous. A global SQL Server Collation Sequence update is the answer to the puzzle, but … Continue reading

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

How to Capture Database(s) usage stats using sp_spaceused and PowerShell

The objective of this article is to look at the possible ways of capturing database usage trends using the most commonly available tools and techniques. The integration of SQL, the use of sp_spaceused, and the flexibility offered by PowerShell have … Continue reading

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

How to analyze SQL Server database performance using T-SQL

The performance of a database is the most challenging and critical part of database optimization. The challenge every DBA faces is to identify the most resource-intensive databases. This article talks about the natively available features that can accomplish the task of … Continue reading

Posted in SQL Server 2017, sysfiles, T-SQL | Leave a comment

SQL Server 2016 enhancements – Truncate Table and Table Partitioning

The idea behind this article is to discuss the importance and the implication of SQL Partition and understand the truncate command partitioning enhancements in SQL 2016 One of the biggest challenges for a DBA is to identify the right candidate … Continue reading

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

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 Operations: Monitoring Disk Space with WMI and OLE Automation Objects

Abstract This article talks about various SQL methods to fetch the disk usage details and use of T-SQL in conjunction with invoking OLE automation procedures and WMI  class libraries using SQL Windows Shell interface. The step by step  details about … Continue reading

Posted in PowerShell, SQL, T-SQL | Tagged , , , , , | 1 Comment

Simple Methods to Recover master.mdf File Password

Overview MS SQL Server is the relational database management system used to store information in form of tables, views, indexes, triggers, constraints and stored procedures. Master Database File (MDF) is the main database file with the file extension .mdf used … Continue reading

Posted in Security, SQL, T-SQL | 1 Comment