SQL Server String Functions

Introduction In this article, we will discuss about the SQL Server String Functions (built in functions) in SQL Server. String Functions in SQL Server ASCII() Return the ASCII code value of a character CHAR() Convert an ASCII value to a character CHARINDEX() Search for a substring inside a string starting from a specified location and... Continue Reading →

Create and Publish SQL Server Database Project With Visual Studio

Introduction Databases plays an important role in any project these days. It becomes too difficult to manage the objects such as Tables, Views, Procedures and Functions increases over the time and also difficult to manage when number of team members works in Database at the same time. And even after that when we manage the... Continue Reading →

Multiple Backup Files of the SQL Server database with SSMS and T-SQL

Introduction In this article, we will learn a simple tip to take multiple backup files of one Database. Sometime we may need more than one copy of a backup file in different file location and we can achieve that in two ways, either using T-SQL Query or using SSMS. T-SQL Statement BACKUP DATABASE [PracticalWorks] TO... Continue Reading →


Introduction In this article, we will discuss the difference between CURRENT_TIMESTAMP , GETDATE() , SYSDATETIME() GETUTCDATE() in SQL Server. Even though all four SQL Server function returns the current date-time in SQL Server, there are some subtle differences between them. The main difference between GETDATE() and SYSDATETIME() is that GETDATE returns current date and time... Continue Reading →

5 Tips to Improve SQL Query Performance

Introduction In this article, I will share few SQL Tips for Boosting our SQL Query Performance. We nobody likes delay in response, right !!. Here are some simple changes that we have to make our query perform faster. The following is the flow of this write-up, Use Schema NameAlways Select ONLY required ColumnsUse NOT EXISTS... Continue Reading →

Get list of Tables & Views in MS SQL Server- sp_tables

Introduction Sometimes we may need to get all the tables and views from a database in MS SQL Server. By using T-SQL Statement sp_tables, we can retrieve a list of tables and views. Syntax sp_tables [ @table_name = 'Table name.' ] , [ @table_owner = 'The database user who created the table.' ] , [... Continue Reading →

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 →

Website Built with WordPress.com.

Up ↑

<span>%d</span> bloggers like this: