Just a day before I was presenting at Virtual Tech Days and I wanted to demonstrate the current time to audience using SQL Server Management Studio, I ended up a quick error. If any of you ever tried to concat multiple values of different datatype this should not be surprise to you.
SELECT 'Current Time ' + GETDATE()
I quickly modified script to following workaround and my script worked right away.
SELECT 'Current Time ' + CAST(GETDATE() AS VARCHAR(20))
Current Time Dec 20 2011 7:00PM
However, I instantly realized that I can use SQL Server 2012 function which can right fit for this situation.
SELECT CONCAT('Current Time ', GETDATE())
Watch a quick video relevent to this subject:
Reference: Pinal Dave (https://blog.sqlauthority.com)