SansSQL

Thursday, July 14, 2022

Display default image when there is no data present for the image URL in Power BI

 

This video describes how to display a default image when there is no data present for the image URL in Power BI.

Tuesday, July 12, 2022

Display URL's as images in Power BI

 

This video describes how to display URL's as images in Power BI.

Friday, July 8, 2022

Connect to Azure Data Lake from Power BI


This video describes how to connect to Azure Data Lake from Power BI.

Download link to Azure Open Datasets: 
https://docs.microsoft.com/en-us/azure/open-datasets/dataset-catalog

Wednesday, May 25, 2022

T-SQL to find Server and SQL restart date time

This script comes handy when you would like to find out the Server and SQL services restart times.
DECLARE @SQLServiceRestartDateTime AS VARCHAR(50),
		@ServerRestartDateTime AS VARCHAR(50)

SELECT @SQLServiceRestartDateTime = create_date FROM sys.databases WHERE database_id=2
SELECT @ServerRestartDateTime = CAST(DATEADD(SECOND, (ms_ticks/1000) * -1, GETDATE()) AS datetime) FROM sys.dm_os_sys_info

SELECT @SQLServiceRestartDateTime AS [SQL Service Start DateTime], @ServerRestartDateTime AS [Server Start DateTime]

Friday, May 20, 2022

T-SQL to find Backup or Restore Progress

Here is a script that comes handy while performing a huge database Backup or Restore. This script provides the details on the progress of the Backup or Restore operation including the estimated finish time.
SELECT 
   session_id AS SPID, command AS [Command], a.text AS Query, start_time AS [Start Time], 
   percent_complete AS [Percent Complete],
   dateadd(second,estimated_completion_time/1000, getdate()) AS [Estimated Completion Time]
FROM sys.dm_exec_requests r 
   CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) a 
WHERE r.command like 'BACKUP%' OR r.command like 'RESTORE%') 

Ads