Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Other Development Tools
 Developing SQL Sprocs in Visual Studio

Author  Topic 

Fromper
Starting Member

33 Posts

Posted - 2013-04-12 : 13:49:24
This is probably a stupid question, but I'm new to Visual Studio, so I'd appreciate any help.

I'm used to working in SQL Server Management Studio, querying tables and writing mostly stored procedures, with the occasional functions, etc. Because I'm working on a new project where other people may modify the same SQL sprocs, and we want to be able to deploy groups of them to our production environment at once, we want to start using Visual Studio for version control and keeping track of the stored procedures. For now, this is just for stored procedures, not for any other changes to the databases.

So in Visual Studio 2012, I successfully created a SQL Database project and copied over our development db from a SQL Server 2012 server. I opened one of the sprocs I need to work on from the Solution Explorer in VS, and I'm able to make changes to it in the VS screen.

However, I can't execute it from there to test my changes. It looks like it's trying to run it against the project in the Visual Studio solution, instead of running against the db that project was created from. If I open the database from the SQL Server Object Explorer in VS, it works just like in SSMS. The problem with that is that it doesn't keep track of the sproc within the database project, track versions, etc.

I'm hoping there's an easy way to track the versions of the sproc through the database project in Visual Studio and also test run it on the db without having to just copy things back and forth between two windows all the time. Any suggestions?
   

- Advertisement -