business calligraphy close up composition

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?


Comments

Leave a comment