What's a quick query to find out whether two fields together are unique and if I can use the combination as a primary key?
Intermediate and advanced users will know this is a simple query to write, however, I see questions like this regularly so I know it's a question that novices struggle with. Here's a simple query to get the information you want.
SELECT ColA,ColB,COUNT(*)
FROM TestTable
GROUP BY ColA,ColB
HAVING COUNT(*) > 1
In ...