Author: Yavuz Selim Kart

Changing Data Type of Column in SQL Server

Hello to everyone, In this article, I will give information about how to change the data type of a column in SQL Server. In SQL Server you may need to change the data type of a column in some cases. You can do this easily using the code below. –Creating...

Adding Primary Key to Table in SQL Server

Hello to everyone, In this article, I will provide information on how to add a primary key to the table in SQL Server. In SQL Server, primary key fields are mostly used in tables. You can also do this using the Designer side. I will do this using code. You...

Connecting to SQL Server Using HeidiSQL

Hello to everyone, In this article, I will try to give information about connecting to SQL Server using HeidiSQL. First, let’s talk about what HeidiSQL is. HeidiSQL; It is a free and open source client for MySQL (versions such as MariaDB and Percona Server), as well as Microsoft SQL Server...

List All Views in SQL Server

Hello to everyone, In SQL Server, in some cases, you may need to list all views. You can easily do this with the help of the code below. SELECT SCHEMA_NAME(schema_id) AS schema_name, name AS view_name, OBJECTPROPERTYEX(object_id, ‘IsIndexed’) AS IsIndexed, OBJECTPROPERTYEX(object_id, ‘IsIndexable’) AS IsIndexable FROM sys.views; When you run the above...

Finding When Backup Was Restored in SQL Server

Hello to everyone, In this article, I will talk about how to find the time when the backup was restored in SQL Server. In some cases in SQL Server, you may want to know when the backup was restored. You can easily do this using the code below. DECLARE @DB...

Printing Your Name as a Triangle in SQL Server

Hello to everyone, In this article, I will talk about how you can print your name as a triangle in SQL Server. In SQL Server, such examples will improve your algorithm logic. You can easily do this by using the code below. DECLARE @i INT, @word VARCHAR(20); SET @i =...

Function Checking Prime Number in SQL Server

Hello to everyone, In this article, I will try to give information about the function that checks the prime number in SQL Server. In SQL Server, in some cases, you may want to check if the number you have is a prime number. You can easily do this using the...

Procedure to Show Script of All Triggers in SQL Server

Hello to everyone, In this article, I will give information about the procedure that show the script of all triggers in SQL Server. In some cases, you may want to script all triggers in SQL Server. You can do this easily with the help of the procedure below. –Creating the...

Don`t copy text!