Category: SQL Server

Finding Unused and Missing Indexes in SQL Server

Hello everyone, In this article, I will try to give information about finding unused and missing Indexes in SQL Server. In SQL Server, in some cases, you may want to find unused and missing Indexes. You can easily do this using the code below. Finding Missing Indexes SELECT TOP 25...

Log File Shrinking in SQL Server

Hello everyone, In this article, I will try to give information about shrinking the log file in SQL Server. In SQL Server, in some cases you may want to shrink the log file. You can easily do this using the code below. USE DatabaseName –You will write the database name...

Viewing Database Restore History in SQL Server

Hello everyone, In this article, I will try to give information about viewing database restore history in SQL Server. In SQL Server, you may want to view the database restore history in some cases. You can easily do this using the code below. SELECT [restore_date] ,[destination_database_name] ,[user_name] ,[backup_set_id] ,[restore_type] ,[replace]...

Creating a New GUID in SQL Server

Hello everyone, In this article, I will try to give information about creating a new GUID in SQL Server. In SQL Server you may want to create a new GUID in some cases. You can easily do this by using the sample code below. SELECT NEWID() When you create and...

Seeing Backup or Restore Progress in SQL Server

Hello everyone, In this article, I will try to give information about seeing the backup or restore progress in SQL Server. In SQL Server, in some cases you may want to see the backup or restore progress. You can easily do this using the code below. SELECT session_id AS SPID,...

Decrypting Base64 Encrypted Data in SQL Server

Hello everyone, In this article, I will try to give information about decoding Base64 encrypted data in SQL Server. In SQL Server, in some cases, you may want to decrypt Base64 encrypted data. You can easily do this using the code below. SELECT CONVERT ( VARCHAR(MAX), CAST(” AS XML).value(‘xs:base64Binary(sql:column(“BASE64_COLUMN”))’, ‘VARBINARY(MAX)’)...

Don`t copy text!