How do you convert the number you get from datepart to the name of the day?

datepart, sql-server

Solution

select datename(weekday, getdate());

Problem

Is there a quick one-liner to call datepart in Sql Server and get back the name of the day instead of just the number? ``` select datepart(dw, getdate()); ``` This will return 1-7, with Sunday being 1. I would like 'Sunday' instead of 1.

Original source