Reputation: 44605
I have a sql server database which has a number of stored procedures. I would like to add these stored procedures to TFS source control in to database project.
It would be a difficult and time consuming task to copy all these over one by one. Is there any automated way or tool that pulls all stored procedures from a database and adds to visual studio database project?
Upvotes: 3
Views: 3594
Reputation: 61
We can resolve this by using Visual Studio 2012. Follow the below steps to resolve this --
Upvotes: 0
Reputation: 2258
It will depend on the version of SQL Server and Visual Studio, but assuming SQL Server 2012 and Visual Studio Premium 2012 or higher
If you have a database project in Visual Studio, you should be able to do a schema compare to the database and pull in all of the objects from the database including stored procedures.
There are some others who have asked similar questions.
For example: http://forums.asp.net/t/1847000.aspx/1 which links to http://msdn.microsoft.com/en-us/data/hh297028 for a SSDT guide.
Upvotes: 2
Reputation: 56735
In SSMS (Management Studio), right-click on the database icon in the Explorer Pane, click "Tasks..." and then "Generate Scripts".
Upvotes: 1