SQL Declare Variable equivalent in databricks

elgeo
Valued Contributor II

Hello. What would be the equivalent of the below in databricks?

DECLARE @LastChangeDate as date

SET @LastChangeDate = GetDate()

I already tried the below and worked. However I need to know how set a sql variable dynamically

SET da.dbname = test;

SELECT "${da.dbname}" AS db_name

Thank you in advance.