Reputation: 6415
I started a Database Project in VS2013 to write and manage some stored procs for an existing database. I don't see any options for using existing databases other than importing SQL scripts. How can I do this?
Upvotes: 3
Views: 5901
Reputation: 1361
I realise this question is very old, I hope this can still help:
You can create a new project in visual studio and select 'SQL Server' in the left hand menu. Fill in the project name and location as usual.
In your newly created database project, select Project, Import, Database. The import database window will open, set up your existing database in here and press start.
There is a more detailed explanation in the link below (but I included the summary above in case the link stops working in the future)
Hope this helps someone.
Upvotes: 1
Reputation: 505
You can indeed create a database project from an existing database in VS2013. Connect to the server in SQL Server Object explorer, right click on the database and select Create New Project.
This will create a project containing scripts for all your tables, views and stored procedures etc. When you have made changes in any of these scripts, you can publish back to the original database, create or apply changes to a new database etc.
You do not use alter scripts but rather change the create script to describe what you want as an end result and the publish works out what needs to be done to put the database in that state.
Note that vs2010 database projects are a different animal from VS2013, and while there is a converter, best idea is probably just to create the VS2013 project as described.
Deborah Kurata has just posted excellent 3 hour course on SQL Data tools for Developers on Pluralsight and like everything else on Pluralsight I cannot recommend it highly enough.
Upvotes: 3
Reputation: 191
it is not possible to manage existing stored procedures/triggers and functions in a database which are written in T-SQL
Upvotes: -4