Is there a way in SQL Source Control to check for object naming conventions and not allow check in if object is not named according to a standard?
Comments
8 comments
-
Interesting idea. Can you give an example of the convention you'd like to enforce?
-
Table and stored procedure names should begin with either "app" or "ssp"
-
Have you thought about using SQL Server's built in policies to enforce this?
-
I'm looking at that right now.
-
Nope - but you could write a tSQLt test for it and run it as part of your build/CI processes.
-
I'm finding out that policies only tell you if there are things not meeting standards. They do not enforce or prevent people from not complying with them. I think this would be a good feature to add to SQL Source Control. Adding this on the TFS side breaks SQL source control.
-
Adding to Alex's suggestion, you might be able to write the tSQLt tests and have them run in a pre-commit hook, which could fail the commit should they not all pass? If this works, it would be a great blog post to share with the wider community.
-
Yes - that's a better idea.
Do what David said.
Add comment
Please sign in to leave a comment.