-1

What are best practices to perform the Schema-Validation in SQL Server ?

I need to test whether a views, stored-procedure, trigger of function points to an existent and working table (or any other objects) or not, and need to perform this check against all objects in the database. I'd like to avoid people introducing broken code and validate that overall schema which should be in a consistent state before releasing in production.

Shall i do it within unit-testing ? what is the best approach ?

I am using CI / TFS and Visual Studio 2015.

Thanks!

1 Answer 1

1

You can try to use Code Review Policy, which allows you to enforce Code Reviews at checkin time. In this way, you can prevent from checking in the broken code.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Cece, many thanks for your reply .. yes it might be an interesting one to do. However, I am much more interested in a solution where the CI server can check the objects validity itself and get back to users with warnings/errors .. i wonder whether it is possible or not ..
Using Code Review Policy is an easy way, or you may need to create a listener to listen to the GettingEventHandler event. Once the check-in event is triggered, send out a warning. almguide.com/2011/12/tfs-server-side-event-handlers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.