Jignesh Raiyani

Jignesh Raiyani
PLE in Windows Performance Monitor

Page Life Expectancy (PLE) in SQL Server

July 17, 2020 by

Page Life Expectancy (PLE) is an age of a data page in seconds in the buffer cache or buffer memory after querying the tables with the loading data page into the buffer memory. Page Life Expectancy value indicates the memory pressure in allocated memory to the SQL Server instance. In most of the cases, a page will be dropped from buffer periodically.

Read more »
Adding Trace Parameter for disable the Identity Cache

Learn to avoid an identity jump issue (IDENTITY_CACHE) with the help of Trace Command (-T272)

July 1, 2020 by

In this article, we will examine the Identity Cache feature and the identity jump issue. Sometimes we see that identity jumps by some specific or random value in the auto-incremental columns, which is known as the identity jump issue. Usually, it occurs when the SQL Server instance is being forced to restart. This skipped gap is particularly depending on the data type of the column, and most of the time, it is possible that column type can be INT, BIGINT, or Numeric.

Read more »
Inserted and Deleted magic tables in SQL Server

Magic Tables in SQL Server

June 23, 2020 by

There are Magic Tables (virtual tables) in SQL Server that hold the temporal information of recently inserted and recently deleted data in the virtual table. INSERTED and DELETED are two types of magic tables in SQL Server. An INSERTED magic table is populated with INSERT and UPDATE operations and DELETED magic table is populated with UPDATE and DELETE operations.

Read more »
Calling SQL Server Procedure inside the Function

Execute a SQL Server procedure inside a function

June 23, 2020 by

In this article, we will ensure that the execution of the SQL Server procedure inside the function is possible. A common understanding of the database developer is that the procedure cannot be utilized or executed inside a user-defined function because the user-defined function does not allow performing DML operation with the table. The procedure is allowed to play with the database and its property, whether a user-defined function isn’t. That should be the essential reason behind allowing the execution of a SQL Server procedure inside the function.

Read more »
Rebuild Index

How to identify and resolve SQL Server Index Fragmentation

May 27, 2020 by

In this article, we will learn how to identify and resolve Index Fragmentation in SQL Server. Index fragmentation identification and index maintenance are important parts of the database maintenance task. Microsoft SQL Server keeps updating the index statistics with the Insert, Update or Delete activity over the table. The index fragmentation is the index performance value in percentage, which can be fetched by SQL Server DMV. According to the index performance value, users can take the indexes in maintenance by revising the fragmentation percentage with the help of Rebuild or Reorganize operation.

Read more »
Thread distribution with SQL Server Degree Parallelism

Importance of SQL Server Max Degree of Parallelism

April 21, 2020 by

In this article, we will discuss how the Max Degree of Parallelism works in SQL Server and how does it improve the query performance. SQL Server Degree of Parallelism is the processor conveyance parameter for a SQL Server operation, and it chooses the maximum number of execution distribution with the parallel use of different logical CPUs for the SQL Server request. Microsoft SQL Server allows setting this Degree of Parallelism parameter value at the SQL Server instance level or Query level. If you do not specify the SQL Server Degree of Parallelism value at the SQL Server instance, then each request or operation has to rely on SQL Server default value and random CPU allocations.

Read more »

SQL Server Hardware Performance Tuning

April 14, 2020 by

SQL Server Performance Tuning can be a difficult assignment, especially when working with a massive database where even the minor change can raise a significant impact on the existing query performance. Performance Tuning always plays a vital role in database performance as well as product performance. A query can be optimized with the proper evaluation of a piece of code or SQL Statements. The important thing in Query Optimization is to understand, which process or expression needs evaluation in the piece of code. Everyone expects to get a quick response from the query on the production, but How?

Read more »
Monitor Transaction Log

Monitor Transaction Log shipping using T-SQL and SSMS

March 10, 2020 by

Database Administrators are vigilant on the backup and restore processes and use the Monitor Transaction log for the same. SQL Server Transaction Log shipping’s prime steps are Transaction Log backup, copy and restore. The answer to solving Disaster Recovery (DR) at the database level can be achieved by SQL Server Transaction Log shipping.

Read more »
New database with Database File Size

How to determine free space and file size for SQL Server databases

March 9, 2020 by

In this article, we will discuss the actual database file size and free space in the database file size with the help of monitoring script and shrink solutions. While creating a database initial size of the database files (Data File and Log File) can be defined by us, with the Autogrowth and MAXSIZE parameter. The initial size will be the same as the model database if by chance user forgot to define the initial size parameter while creating a database or do the same intentionally.

Read more »

How to configure SQL Server Log Shipping

March 5, 2020 by

SQL Server Log shipping provides a DR (disaster recovery) solution for the SQL Server databases and it can be configured at the database level. In a specific time-gap, SQL Server Transaction Log backup will be taken and copied to the destination site and will be restored. This complete activity or solution will be done by SQL Server job and each step is configured by the user. The learner may confront the difficulties in a couple of steps or while troubleshooting but for the experienced user, it is too easy to set up and handle the SQL Server log shipping set up errors.

Read more »
SQL Server Auto Shrink option

SQL Server Auto Shrink database property

March 5, 2020 by

In this article, we will discuss the SQL Server Auto Shrink database property, which allows SQL Server to automatically shrink the database files when the value is configured as True in the database option. Automatic shrink operation is done by the server auto shrink database feature, which is the main course of this article.

Read more »
Form to XML

XQuery examples to delete SQL XML documents

February 5, 2020 by

Delete operations over SQL XML should be possible with either erasing the XML document with the XML data type column or delete XML tag or attribute in the XML document using XQuery. The utilization of the XML data type with XQuery is tricky and significant in SQL Server.

Read more »

Converting commas or other delimiters to a Table or List in SQL Server using T-SQL

January 31, 2020 by

Database developers often need to convert a comma-separated value or other delimited items into a tabular format. Delimiters include pipe “|”, hash “#”, dollar “$” and other characters. SQL Server compatibility level 130, and subsequent versions, support a string_split() function to convert delimiter-separated values to rows (table format). For compatibility levels under 130, developers have previously done this with a user-defined function, which incorporates a While loop or Cursor to extract the data.

Read more »
Database Collation

SQL Server collation introduction with collate SQL casting

January 27, 2020 by

SQL Server collation refers to a set of character and character encoding rules, and influences how information is stored according to the order in the data page, how data is matched by comparing two columns, and how information is arranged in the T-SQL query statement. Collate SQL follows rules applied on a table when Select, Insert, Update or Delete operations are performed against contained data. Data always follows collation constraint rules, which are configured when creating an object.

Read more »

Generate XML Forms or XML Data Type Documents in SQL Server

January 27, 2020 by

In this article, we’ll show how to create an XML data type document from a relational table utilizing different T-SQL ways. For example, for data migration, information from the SQL Server database can be exported and imported using XML in another framework. XML is a standard way of extracting, storing and manipulating data. One aspect of working with the XML data type is creating XML from relational information, which is done using the FOR XML provision in SQL Server:

Read more »
Edit XML Document

Different ways to update XML using XQuery in SQL Server

January 23, 2020 by

XQuery is a query language for XML. XML is a markup language that provides software and hardware-independent way of storing, transporting, and sharing data. In this case, XML documents are stored in a SQL Server database. XQuery is used to manipulate, find and extract information stored in the XML format. It’s analogous to SQL for databases.

Read more »
Ranking Function Query with Result

Replace a SQL While loop and a cursor with ranking functions in SQL Server for better query performance

December 19, 2019 by

SQL While loop and cursor are the most common approach to repeat a statement on condition-based or determined limits. Loop and cursor can be utilized in a circumstance to deal with row-based processing in T-SQL. We generally observe moderate execution of old made procedures, which are composed of using loop and cursors. Those procedures take time, especially when the number of iteration count is big for the execution.

Read more »

Query Performance Issues on VARCHAR Data Type Using an N Prefix

December 6, 2019 by

In this article, we’ll discuss data type VARCHAR and query performance issues associated with utilizing the lower level VARCHAR data type. CHAR, VARCHAR and NVARCHAR are data types that support storing information in text format in a SQL Server database. These data types allow a wide assortment of character sets in the defined field or column in the database table.

Read more »
List SQL jobs with status

Audit and Alert SQL Server Jobs Status Changes (Enabled or Disabled)

December 4, 2019 by

In this article, we will talk about how to track enabled or disabled SQL jobs in SQL Server using T-SQL. Users with the Sysadmin role have the default permissions to modify the information of any jobs in SQL Server. If a user is not in this role and wants access to this activity, then the user needs to be given the SQLAgentOperatorRole in the msdb database.

Read more »