Selecting Only EVEN or ODD Records from Tables – MS SQL SERVER

Introduction In this article, we will learn to Select only EVEN or ODD records from the MS SQL Server database table🤔. The efficient way to find the record belongs to even or odd is determining by the table's ID column. Select EVEN Records By applying the modulo operator by 2 for the ID column, we... Continue Reading →

Optimize your SQL Query – Replace Star (*) in Select Statement – MS SQL Server

Introduction Sometime we may need almost all the columns from a table result. In this scenario we use Star(*) in our select statement i.e. as SELECT * FROM TableName. Using Star(*) in the select statement is BAD. The best approach is selecting the table with column names. In this article we will learn how quickly... Continue Reading →

Backup Database using T-SQL Statements

Introduction In this article, We will discuss how to backup our database in MS-SQL Server using T-SQL Statements. We need to use BACKUP DATABASE statement to create full database backup, along with the name of Database and device to store the backup file. Syntax BACKUP DATABASE database_name TO device_name Example BACKUP DATABASE PracticalWorks TO DISK... Continue Reading →

Pinned tabs in SQL Server Management Studio (SSMS)

Introduction While working in SQL Server Management Studio (SSMS), we may need to open many query windows. But each time we may feel difficult to recognize the important query window which we need to refer frequently. There is an option, we can Pin the tabs which are mostly frequently referred. Pinning Tabs We can pin... Continue Reading →

Split Query Window in SQL Server Management Studio(SSMS)

Introduction Sometime we may write a long query in our query window and we may need to refer the objects or other part of the T-SQL frequently. For that we may be scrolling up and down in the query window. But we have an awesome option for that in the SQL Query Window, which many... Continue Reading →

Last Execution of Stored Procedure in SQL Server

Introduction In an ERP project or any other big applications, there may be many Stored Procedures used. But we are not sure that all the stored procedures are required or not or valid ones. While the requirement(s) has changed, we may ended with another new stored procedure or based on the performance we may have... Continue Reading →

List Databases Available for Current User -SQL Server

Introduction Sometimes, we may be curious to know to which databases do we have access or we need to access a particular database but not sure that we have access or not. In this article, we will discuss a T-SQL that will list the Databases available for current user. For Particular Database HAS_DBACCESS  - This... Continue Reading →

Find user who ran DROP statements – SQL Server

Introduction Sometimes we need to track or find which user has DROPPED the table(s) from the Database. In this article, we will discuss the possible ways to track this situation. I have a table already in my Database, SELECT [StudentId], [FirstName], [LastName] FROM [StudentManagementSystem].[Students].[StudentDetails] Fig 1. Results Drop table Now I am going to apply... Continue Reading →

WordPress.com.

Up ↑

%d bloggers like this: