<p>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?</p>

<pre><code>select datepart(dw, getdate());
</code></pre>

<p>This will return 1-7, with Sunday being 1.  I would like 'Sunday' instead of 1.</p>

[{'answer_id': 12541, 'author': 'Andrew Grant', 'author_id': 1043, 'author_profile': 'https://Stackoverflow.com/users/1043', 'pm_score': 0, 'selected': False, 'text': "<p>This is not possible without using the result to select the day yourself. For one thing the textual representation of the day is locale-dependent. For another the returned value depends upon the 'datefirst' setting.</p>\n"}, {'answer_id': 12544, 'author': 'Lars Mæhlum', 'author_id': 960, 'author_profile': 'https://Stackoverflow.com/users/960', 'pm_score': 0, 'selected': False, 'text': '<p>If you want a localizable solution, just join the result against a table with the names and numbers.</p>\n'}, {'answer_id': 12548, 'author': 'Erick B', 'author_id': 1373, 'author_profile': 'https://Stackoverflow.com/users/1373', 'pm_score': 5, 'selected': True, 'text': '<pre><code>select datename(weekday, getdate());\n</code></pre>\n'}, {'answer_id': 12549, 'author': 'Eric Z Beard', 'author_id': 1219, 'author_profile': 'https://Stackoverflow.com/users/1219', 'pm_score': 1, 'selected': False, 'text': "<p>It actually took me more searching than I thought it would to find this answer.  It's funny how you can use a technology for ages and never know about simple functions like this.</p>\n\n<pre><code>select datename(dw,  getdate())\n</code></pre>\n\n<p>I'm not sure how localization would work with this function.  Getting the name client-side is probably the answer, but it would be nice to do it on the database.  Would Sql Server use the collation setting to determine the output for this?</p>\n"}]
['https://Stackoverflow.com/questions/12533', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1219/']