What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

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 (code.google.com/p/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

1 Answer 1

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 .