MSSQL Query Blog

Getting Schema List of All Databases in SQL Server

Hello to everyone, In this article, I will try to give information about getting the Schema list of all databases in SQL Server. In SQL Server in some cases you may want to get the Schema list of all databases. You can easily do this using the code below. DECLARE...

Listing Locked Tables in SQL Server

Hello to everyone, In this article, I will try to give information about listing locked tables in SQL Server. In SQL Server you may want to list locked tables in some cases. You can easily do this using the code below. SELECT STR(request_session_id, 4, 0) AS spid, CONVERT(VARCHAR(12), DB_NAME(resource_database_id)) AS...

Finding Fragmentation Rates of Indexes in SQL Server

Hello to everyone, In this article, I will try to give information about finding Fragmentation rates of Indexes in SQL Server. In SQL Server, in some cases, you may want to find the Fragmentation rates of Indexes. You can easily do this using the code below. SELECT ps.object_id, i.name AS...

Listing Sizes of Tables in Database in SQL Server

Hello to everyone, In this article, I will try to give information about listing the dimensions of the tables in the database in SQL Server. In SQL Server, in some cases you may want to list the sizes of the tables in the database. You can easily do this using...

Creating Entity Class from Database Table in SQL Server

Hello to everyone, In this article, I will try to give information about creating Entity Class from database table in SQL Server. In SQL Server, in some cases you may want to create Entity Class from database table. You can easily do this using the code below. DECLARE @TableName sysname...

List IDENTITY Columns of All Tables in SQL Server

Hello to everyone, In this article, I will try to give information about listing the IDENTITY columns of all tables in SQL Server. In SQL Server, in some cases you may want to list the IDENTITY columns of all tables. You can easily do this using the code below. SELECT...

Don`t copy text!