Archive
SQL Trivia – How to convert milliseconds to [hh:mm:ss.ms] format
Today for some reporting purpose I need to convert milliseconds to hh:mm:ss.ms format, i.e.
Hours : Minutes : Seconds . Micro-Seconds
So, I tried to create query below, of course by taking help from internet, so that I can have a sample code handy for future reference:
DECLARE @MilliSeconds INT SET @MilliSeconds = 25289706 SELECT CONCAT( RIGHT('0' + CAST(@MilliSeconds/(1000*60*60) AS VARCHAR(2)),2), ':', -- Hrs RIGHT('0' + CAST((@MilliSeconds%(1000*60*60))/(1000*60) AS VARCHAR(2)),2), ':', -- Mins RIGHT('0' + CAST(((@MilliSeconds%(1000*60*60))%(1000*60))/1000 AS VARCHAR(2)),2), '.', -- Secs ((@MilliSeconds%(1000*60*60))%(1000*60))%1000 -- Milli Secs ) AS [hh:mm:ss.ms] -- 7 Hrs, 1 minute, 29 seconds and 706 milliseconds
Microsoft Azure Data Platform – July (2017) update
Microsoft Azure updates curated from July-2017 on: Azure SQL DB/DW, HD Insight, Machine Learning (ML), Azure Data Lake (ADL), Power BI, and more.
1. Handling data encoding issues while loading data to Azure SQL Data Warehouse
2. Super Charge Power BI with Azure Analysis Services
3. Azure SQL Data Warehouse previews 3x compute scale with unlimited columnar storage
4. Public Preview of compatibility level 140 for Azure SQL databases
5. Resumable Online Index Rebuild is in public preview for Azure SQL DB
6. Database Scoped Global Temporary Tables in public preview for Azure SQL DB
7. Azure Data Lake Tools for Visual Studio Code (VSCode) July updates
8. Tableau and Azure SQL DB, a match made in the cloud
9. Artificial Intelligence tunes Azure SQL Databases
10. How Azure Security Center helps protect your servers with Web Application Firewall
11. Introducing the Azure Analysis Services web designer
12. Go serverless with R Scripts on Azure Function
13. HDInsight tools for IntelliJ & Eclipse June updates
14. Model comparison and merging for Azure Analysis Services
15. Enhance Azure SQL Data Warehouse performance with new monitoring functionality for Columnstore
16. Import Power BI Desktop files into Azure Analysis Services