MSSQL Query Blog

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...

Split Function in SQL Server

Hello everyone, In this article, I will try to give information about the Split function in SQL Server. In SQL Server, in some cases, you may want to show the comma strings you have in a tabular form by separating them with Id. You can easily do this using the...

Listing All Users in SQL Server

Hello everyone, In this article, I will try to give information about listing all users in SQL Server. In SQL Server you may want to list all users in some cases. You can easily do this using the code below. SELECT name AS username, create_date, modify_date, type_desc AS type, authentication_type_desc...

Don`t copy text!