views:

158

answers:

1

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:

  1. I work locally modifying a SQL schema via SQL Server Management Studio.
  2. Next I open up the Visual Studio database project & perform a "Schema Compare" operation.
  3. I choose my local database with the latest changes as the "Source Schema" and the "Target Schema" as the database project.
  4. Next I look at the "Schema Comparison" results and choose "Skip" for the "Update Action" on items that I do not want to change. For the items I do want to change I choose the appropriate "Update Action".
  5. When I am finished I then choose the "Write Updates" command to apply the changes to the database project.

The problem that I have is that when I look at the database project, some of the database tables that I told to ignore get updated in the database project by commenting out the database create script.

For example this is what one looks like:

/*CREATE TABLE [SchemaName].[TableName] (
    [Col1]     BIGINT           IDENTITY (1, 20) NOT NULL,
    [Col2]     INT              NULL
);*/

The question is: Since I told the compare to ignore this table then why did it modify the project and comment out the code?

A: 

Ok people I found a solution for this issue via a fellow co-worker.

It turns out that there is an extra step you need to do while performing the Schema Compare:

Step 4A - After choosing the appropriate "Update Action" for all items you must now click the "Refresh" button. After you perform a refresh you may proceed to step 5.

KenB

related questions