Author: Yavuz Selim Kart

Shrinking Tempdb Database in SQL Server

Hello everyone, In this article, I will try to give information about shrinking the Tempdb database in SQL Server. In SQL Server, in some cases, you may want to shrink the Tempdb database. You can easily do this using the code below. CHECKPOINT; GO DBCC DROPCLEANBUFFERS; GO DBCC FREEPROCCACHE; GO...

Encryption Operations in SQL Server

Hello everyone, In this article, I will try to give information about encryption operations in SQL Server. In SQL Server, in some cases, you may want to encrypt the data you have. You can easily do this using the code below. DECLARE @TestData NVARCHAR(MAX) = N’Yavuz Selim Kart’; SELECT HASHBYTES(‘MD2’,...

Reporting CPU Usage in SQL Server

Hello everyone, In this article, I will try to give information about reporting CPU usage in SQL Server. In SQL Server you may want to report CPU usage in some cases. You can easily do this using the code below. SELECT DB_NAME(st.dbid) AS DatabaseName, OBJECT_SCHEMA_NAME(st.objectid, dbid) AS SchemaName, cp.objtype AS...

Finding Table by Column Name in SQL Server

Hello everyone, In this article, I will try to give information about finding a table from the column name in SQL Server. In SQL Server, in some cases, you may want to find a table by column name. You can easily do this using the code below. SELECT COLUMN_NAME, TABLE_NAME...

Viewing Memory Usage in SQL Server

Hello everyone, In this article, I will try to give information about viewing Memory usage in SQL Server. In SQL Server you may want to view Memory usage in some cases. You can easily do this using the code below. select (physical_memory_in_use_kb / 1024) Phy_Memory_usedby_Sqlserver_MB, (locked_page_allocations_kb / 1024) Locked_pages_used_Sqlserver_MB, (virtual_address_space_committed_kb...

Writing Oracle NEXT_DAY Function in SQL Server

Hello everyone, In this article, I will give information about writing the Oracle NEXT_DAY function in SQL Server. In SQL Server, in some cases, we may want to see and use functions that exist in other databases. What is the NEXT_DAY function? The NEXT_DAY function has 2 parameters. The first...

PostgreSQL Equivalents of Data Types in SQL Server

Hello everyone, In this article, I will try to show the PostgreSQL equivalents of data types in SQL Server. SQL Server and PostgreSQL have similar data types. Most are equal but some are not. When migrating from SQL Server to PostgreSQL, it is important to keep the correct type mapping...

Don`t copy text!