Choose your names wisely

Tip: Avoid using reserved words as object names.

The other day, I chose a name for a schema in SQL Server that had some unintended consequences. I had created some audit tables to track historical changes and named the schema “audit”. It didn’t occur to me that “audit” is a SQL Server reserved word. I was able to create the tables in my dev environment and then checked them into my database project. When I tried to deploy my database project to my test server, it didn’t pick up any objects in the audit schema. After quite a bit of troubleshooting, I sheepishly realized my mistake and changed my name from “audit” to “aud”. Then magically, my objects deployed.

Have you ever named something that caused some headaches?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Powered by WordPress.com.

Up ↑

Discover more from Datagami

Subscribe now to keep reading and get access to the full archive.

Continue reading