Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I was playing with the Data Explorer, and was doing a simple query to see how many posts appeared by month. This was my query:

select datepart(year, p.creationdate) as year, 
datepart(month, p.creationdate) as month,
count(*) as postcount
from posts p
group by datepart(year, p.creationdate), 
datepart(month, p.creationdate)
order by datepart(year, p.creationdate), 
datepart(month, p.creationdate)​​​​​​

However, "datepart" and "month" aren't being recognised as keywords for syntax highlighting. This is understandable for the main site, since it's a bit obscure, but it might be helpful to increase the number of recognised reserved words for the SEDE editor, since it only needs to handle the one language.

Having noticed this, I did a bit of extra playing. The editor appears to not know the TSQL CASE statement, either: case when [body] like '%sql%' then 1 else 0 end highlights only the "like '%sql%'" and the 1 and 0.

Is it possible to add these in?

share|improve this question
I know that Stack Overflow uses google-code-prettify ( for code highlighting, but I'm not sure what SEDE uses (although it's easy to check). If it turns out to be prettify, you should request that they add it over there. – Maxim Zaslavsky Aug 12 '10 at 21:41
up vote 1 down vote accepted

Okay, I added a whole bunch of keywords and functions to the syntax highlighting.

If I missed any other important ones, let me know.

Oh, for day, month, and year, those are both keywords and functions in SQL -- in SSMS they show up highlighted as functions in both cases, so that's what I put them in as in SEDE.

Edit: This is now live.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .