Best Practice on using SCHEMABINDING on all Views and Functions?

From my purely anecdotal, grumpy DBA experience, I like the idea of using SCHEMABINDING as much as possible (although I haven't it used it much, typically only when required like indexed views, etc.)

I like that it forces some kind of discipline, you can't just through SELECT * in there, you need to specify schema and tables, etc. I've worked on too many fire-and-forget database designs, it's tiring. I didn't know that it could improve performance, so thanks for that! More ammo for when I make the suggestion. And if it prevents people from changing or dropping the table schema easily, GREAT! Let them think it through first.

I've used SCHEMABINDING in a presentation as an example to prevent accidental alter/drop, and it gets excellent feedback. (Seems like a lot of developers have no trouble dropping and creating tables all the time) I even demo'd an uber-view that includes every table with SCHEMABINDING simply to prevent them being dropped, and it does no actual data access.

1 Like