I have to concat a few fields to generate a unique key, and in order to do that I want to combine 3 fields with different data types: integer
, date
and string
.
What I used in SQL Server 2012:
CONCAT(PMEOBJECT.OBJECTID, '-', PMEOBJECT.FROMDATE, '-', PMEBUILDING.NAME) AS OBJECTIDKEY
Any ideas how to write this in SQL Server 2008?
edit: also NULLS have to be taken into account. editedit: I added ISNULL(PMEOBJECT.FROMDATE, '') in between to make it work. Thanks all.