database-project

How do you actually use Visual Studio Team System database projects to version Sql Server

How are you supposed to correctly use a Visual Studio Team System database project to implement version control on a sql server database? This might seem overly generic but everything I've found so far online hasn't helped me in being able to achieve anything useful. I have managed to find functionality that appears to be similar to fea...

What happened to the "Run" and "Run On" commands in Visual Studio 2010 Database Projects?

Hello, I have migrated a database project from VS2008 to VS2010. While in VS08, I used to be able to right-click on a .sql or .cmd file and select a "Run" or "Run On" command from the context menu. In VS2010, though, these menu items seem to have gone away. I have a number of .sql and .cmd scripts that I am used to being able to run ...

VS 2010 Database Project Run Script Conditionally

I am new to VS 2010 database projects, in the past I've used dbp projects but are not longer supported in VS 2010. I would like to run a set of sql scripts that add test data, but would ideally like this to only run based on the project configuration. For example, if I can have a VS "Test" configuration that would execute this set of ...

Visual Studio 2010 Database Project does not understand Schema Names anymore?

I just tried to upgrade a Visual Studio 2008 Database project to VS2010 and actually it is quite a mess. Hundreds of warnings, all unsolved references. It seems to boil down to Visual Studio not to understand Schema Names (aka Ownership) anymore. For example, the default dbo schema: [$(MyDataBase)].dbo.MyTable is fine but: [$(MyDataB...

Visual Studio 2010 Database Projects: Are there any videos/tutorials or comments about the new Database Project Types?

I have recently upgraded to Visual Studio 2010. I have kept database projects separate to application projects. The database project was converted from and old DPR project and added a whole lot of additional folder. I deleted those, but now I suspect I need to recreate the project as these new projects work very differently. Now that I ...

VS2010 Database Compare. How do you create a *.DBSchema extensioned file?

I'd like to take a snapshot of my database, make some changes and then use the db compare functionality to identify the changes, and who knows, maybe even generate scripts to make the change. I'd like to avoid having to backup the current db and restore it as a separate db just to have a "before" snapshot. I'm guessing I shouldn't have ...

How to create item templates for SQL files, for Visual Studio Database Projects

It's possible to define your own custom templates for normal project types, such as templates for C# files, for a Class Library project. What about a 'Database Project' scenario? I would like to define a standard template for adding a stored procedure, which uses the company's conventions for all stored procedures, such as standard com...

SQL Server schema comparison - leaves behind obsolete files on synchronization

Directly related to http://stackoverflow.com/questions/2768489/visual-studio-2010-database-project-is-there-a-visual-way/2772205#2772205 I have a problem synchronizing between database project and a database in Visual Studio. Usually I synchronize FROM database TO database project (using the Visual Studio > data > scheme compare > new ...

How can I script the deployment of a Visual Studio database project?

How can I script the deployment of a Visual Studio database project? I have a DB project in visual studio and I would like to use it in order to deploy on remote machines via a script. I notice that when I 'deploy' from visual studio, it generates a .sql file. I intercepted this file and tried running it from the command line with osq...

Visual Studio 2010 database project does not recognize SQL 2008 geography data type

I've created a new SQL 2008 database project in Visual Studio 2010 and filled it with the contents of a local SQL Express database. When I try to build the database project I get this error: SQL03006: Column: [dbo].[table1].[geog] has an unresolved reference to Sql Type [dbo].[geography] I've done some searching and it may be missing a ...

VS2010 ultimate DataBase Project + SQL Server 2008: Updating Project from Database

Hello everyone, this is a quick question: I have this Database Project in a Web app solution with the real database. I want to update the database using SQL server managment studio, and then update the corresponding VS project. This can be done? I know that you can update the scripts in the project, but I'm not the SQL kind of guy, ...

Visual Studio 2010 SQL Server Database Project - Ignore Stored Procedures and Functions

I really like the new SQL Server Database projects in Visual Studio 2010. I also like using the "Generate DROP statements for objects that are in the target database but that are not in the database project" option in the deployment properties. However, I do not want to manage Stored Procedures and Functions using this interface; I hav...

Looking for alternatives to the database project.

I've a fairly large database project which contains nine databases and one database with a fairly large schema. This project takes a large amount of time to build and I'm about to pull my hair out. We'd like to keep our database source controlled, but having a hard getting the other devs to use the project and build the database project...

Find completely commented files which are commented by /* */.

Similar to this question. I would like to find all commented files. But in my case /* */ is a possibility. Apparently when you write changes to a database project, dropped objects are only commented out instead of deleting the file. I would like to remove all of these commented out files from the project. Is is possible to find all fil...

How to organize asp.net mvc project (using entity framework) and a corresponding database project?

I recently switched to vs2010 and am experimenting with asp.net MVC2. I am building a simple website and use the entity framework to design the data model. From the .edmx file, I generate the database tables. After a few iterations, I decided that it would be nice to have version control of the database schema as well, and therefore I a...

Synchronizing an ERWin model with a Visual Studio 2008 GDR 2/2010 db project

I am looking for options to get our vast collection of DB objects across many DBs into source control (TFS 2010). Once we succeed here, we will work toward generating our alter scripts for a particular DB change via TFS build. The problem is, our data architecture group is responsible for maintaining the DB objects (excluding SPs), and ...

How do I upgrade a database using WIX?

I have a Visual Studio 2010 database project and a WIX installer. What is the best way to go about installing that database to a server using that WIX installer? How would I set that up? I'm having a hard time with WIX as it is, so hopefully somebody has some insight into how to deal with this. ...

"Model already has an element" errors (TSD04105) when using Visual Studio 2008 Database Project GDR2

I am using Visual Studio 2008 Database Project GDR2 to manage multiple databases and I am getting a number of errors related to synonyms. Project-A has a reference to Project-B because Project-A has a number of synonyms to tables in Project-B. The full error I'm getting is "TSD04105: The model already has an element that has the same...

Will Visual Studio 2010 database projects work with .Net 3.5?

I notice that Visual Studio 2010 database projects have a re-distributable component to support the deployment on end-user systems. Will this component work against .Net 3.5, or does it require .Net 4.0? ...

Merge Issues With Visual Studio 2010 Database Project Schema Compare & TFS

I am experiencing an issue working with a database project in Visual Studio 2010 Ultimate with TFS. The following describes the work flow that I use: I work locally modifying a SQL schema via SQL Server Management Studio. Next I open up the Visual Studio database project & perform a "Schema Compare" operation. I choose my local databas...