views:

98

answers:

4

I have connected the Team Foundation Server to my SQL Server 2005 Management Studio and added my Stored Proc's to the new project to TFS. All my SP's are checked in and everything works fine. But I have a question. I have my project that shows in Solution Explorer and I have the Object Explorer that shows all the Databases and SP's on the left hand side. If another user comes in and creates a new SP that SP shall not be added to the TFS. Is there a way to make sure that people only run the SP's from the Solution Explorer and not be able to create from the Object Explorer?

A: 

The ones in object explorer are the ones in the database they're the only ones that ever run.


An update based on comments:

You should treat the database just like it's code. You need automated tests to make sure that what you check in doesn't break anything and that it actually does what you wanted it to do. You then need to set up a continuous integration system, so that any time that anything gets checked in, it's all built, and unit tested, and deployed, and integration tested.

In the case of the database, this would involve running all the update or create scripts against a clean database to make sure they'll run when you're ready for production; then testing the stored procedures to make sure they do what they're s upposed to; then testing all the code that uses them; and doing this on every check-in, so that any problems are found quickly - near the time the bugs are introduced.

John Saunders
i know what they are.. that wasnt my question. my question is how can i make sure that the user creates SP's which are added to TFS project and not have TFS as just a backup
I still don't understand. You want to make sure every stored procedure ever created is added to the TFS project? Even before it's finished?
John Saunders
heres the thing. I have 1 database, with say 10 SP's. Now i added those SP's to the TFS solution. so everything is fine now. A new user comes and creates a new SP in the DB and forgets to add it in the TFS. Is there a way to restrict his negligence? Like any SP created is compulsorily created in the TFS solution itself?
No, and that's not a good idea. Again, he'd create it and you'd want it checked in before it's finished.
John Saunders
A: 

You could limit people's permissions to create a stored procedure. You would need everyone to inform your DBA to run the script to create the stored proc.

Babak Naffas
+1  A: 

If you're using Team System for Database Professionals you can compare the schema with the database project. Then you'd get a heads up that there was a new stored procedure in the database. This isn't exactly what you're asking for, but it would give you a way to see all the added stored procedures so you wouldn't be in the dark. You could just plan on running this compare at a certian point in your release cycle each time.

Ryan
A: 

An easy way to do this is with this product Randolph which will make sure any single change is actually in TFS. it runs in the background and you don't have to worry about it. All you know is that TFS will automatically have all your changes in there"

Itamar