Rune Bivrin (6/25/2012)
I beg to differ. You can't define indexes on table variables. You can define constraints that will cause SQL Server to create indexes under the hood, but that's a different kettle of fish.
On the contrary, I think that's exactly the kettle of fish the question asks about. "A Table Variable can have primary keys and indexes defined." I don't see the word "you" in there. Can indexes be defined on a table variable? Well, they can exist, and they're certainly not undefined, so the answer must be yes. If you want to clarify, you can say, "yes, by SQL Server when you define a constraint." Can you define them directly? No. But the question didn't ask that. A table variable can have indexes defined, regardless of whether or not you can explicitly define them. Seems like standard QotD material to me.
I can't dunk a basketball either. Doesn't mean a basketball can't be dunked. I can even hand off the ball to another player who can dunk it. Maybe he'll define an index while he's up there.
Though I suppose a system table is a better example. Can a system table contain rows? Can you add rows to a system table? (setting aside DAC for the moment)
NULL is not zero
NULL is not an empty string
NULL is the unknown