MSSQL Query Blog

Simple Interest Calculation Function in SQL Server

Hello everyone, In this article, I will try to give information about the simple interest calculation function in SQL Server. In SQL Server, in some cases, you may want to calculate interest simply. You can easily do this using the function below. CREATE FUNCTION dbo.SimpleInterestFunction ( @Principal DECIMAL(18, 2) =...

Converting Empty Value to Datetime in SQL Server

Hello everyone, In this article, I will try to give information about converting empty value to Datetime in SQL Server. In SQL Server, in some cases, you may want to convert an empty value to Datetime. You can easily do this using the code below. SELECT CAST(” AS DATE); When...

Trigger Preventing Table Creation in SQL Server

Hello everyone, In this article, I will provide information about creating triggers that prevent table creation in SQL Server. In SQL Server, in some cases, we may not want a table to be created in the current database. You can easily do this using the code below. CREATE TRIGGER StopTableCreation...

Finding the Last Restore Date of a Backup in SQL Server

Hello everyone, In this article, I will try to give information about finding the last restore date of a backup in SQL Server. In SQL Server, in some cases you may want to find the last restore date of the backup. You can easily do this using the code below....

Listing All Time Zones in SQL Server

Hello everyone, In this article, I will try to give information about listing all time zones in SQL Server. In SQL Server you may want to list all time zones in some cases. You can easily do this using the code below. SELECT * FROM sys.time_zone_info When you run the...

Most Used Database Files in SQL Server

Hello everyone, In this article, I will try to give information about finding the most used database files in SQL Server. In SQL Server, in some cases you may want to find the most used database files. You can easily do this by using the script below. SELECT DB_NAME(DbId) ‘Database...

Don`t copy text!