MSSQL Query Blog

Filenames by Version in SQL Server

Hello everyone, In this article, I will provide information about finding filenames by version in SQL Server. In SQL Server, in some cases we may want to know which version of SQL Server is installed based on the file name. With the help of the information below, you can easily...

Finding Table Column Count in SQL Server

Hello everyone, In this article, I will give information about finding the number of table columns in SQL Server. In SQL Server, in some cases, we may want to find the number of columns in a table. You can easily do this with the help of the code below. I...

Dynamic Where Query in SQL Server

Hello everyone, In this article, I will give information about the use of dynamic where query in SQL Server. In SQL Server, in some cases, you may want to use two or more where conditions dynamically. I created the following code based on the Northwind database. You can use it...

Learning File Size Information of MDF and LDF’s in SQL Server

Hello everyone, In this article, I will provide information about learning the file size information of MDF and LDF’s in SQL Server. With the help of the code below, you can learn the file size information of all databases in SQL Server. SELECT DB_NAME(mf.database_id) AS DatabaseName, mf.physical_name AS PhysicalPath, size_on_disk_bytes...

Function to Clear Non-Numeric Characters in SQL Server

Hello everyone, In this article, I will give information about the function that clears non-numeric characters in SQL Server. In SQL Server, in some cases, we may want to remove parentheses, dashes, etc. on a numeric text. You can easily do this with the help of the function below.  ...

Listing Foreign Keys of Selected Table in SQL Server

Hello everyone, In this article, I will provide information about listing the Foreign Keys of the selected table in SQL Server. In SQL Server, in some cases, you may want to list the Foreign Keys of the selected table. You can easily do this using the code below. SELECT t.name...

Don`t copy text!