If you're talking SQL Server, the series of SQL books by Solid Quality Mentors are well worth a read.
I personally can recommend:
I think they're a great set to have on your bookcase.
I guess I could rattle off some exams, like the MCP exams, or BrainBench, but you have to pay lots of money for those.
If you were really sold on taking an exam to gauge your competency, you could get a one of the MCP exam prep guides for ASP.NET, C#, and SQL Server and see how well you comprehend and take in that material. I'm not sure that it's the most accurate way of measuring competency though.
You can get a good qualitative evaluation of your SQL Server skills by simply reading Itzik's or Kalen's books and seeing how you comprehend them. For .NET, read Richter and critically evaluate yourself against the concepts you find in that book. Do those concepts make sense?
Probably the most valuable way to get feedback is to ask your senior developers for a frank evaluation of your skills.
If you're asking how I evaluate my junior developers, it's pretty easy once I see their code and they get a track record for a few months, but I don't believe quantitative analysis is the best way. Instead, I ask questions like:
Ask yourself how your leaders would answer these questions about you. If you are seriously confident that they will respond positively, you will have an easier time "grading yourself".
I looked a long time for resources to help me understand exactly how the query optimizer worked, and how to really make sense of the query plans. I finally found this:
T-SQL Querying, by Itzik Ben-Gan
For Sql Server 2005, I haven't found anything else that gets close.