Deploy SQL Server Database project (*.dacpac) with SqlPackage.exe

The SqlPackage.exe tool is included in SQL Server Data Tools (SSDT) for Visual Studio 2012. It replaces the VSDBCMD.exe tool (used for *.dbschema, VS2010 database project).

To deploy to your several environments (DEV, INT, TEST, PRE-PROD, PROD), it’s very easy, you don’t need to install SSDT. Just create a folder with SqlPackage.exe and its dll needed :

1- Create Folder on the target Server (INT, TEST…) -> C:\SSDT\

2- Initialize your environment copying files in the 2 folowing folders from your machine to the created folder in previous step (C:\SSDT\) . If these folders don’t exist on your dev machine, you have to install SSDT.

* C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin

SqlPackage

*C:\Windows\Microsoft.NET\assembly\GAC_MSIL\ Microsoft.SqlServer.TransactSql.ScriptDom\v4.0_11.0.0.0__89845dcd8080cc91

SqlPackage2

3- Now, you can use the SqlPackage.exe command from the target Server to deploy/publish your database (*.dacpac file)

C:\SSDT\SqlPackage.exe /Action:Publish /SourceFile:”YourBuildOutputFolder\YourFileName.dacpac/Profile:”YourBuildOutputFolder\YourFileName.Publish.xml” /tdn:YourDatabaseName /variables:MyVar1=”value1″ /variables:MyVar2=”Value2″

What’s new in Visual Studio 2012 Database Project ?

The lastest version of database project (VS 2012) has a lot of changes. Do not be afraid after your upgrading from the VS 2010 version.

1) New database project type : “SQL Server Database project” (*.sqlproj)

New DB Project

2) “Publish” replaces “Deploy” action

publish

Publish” is linked with a new concept : “Profile“. “Profile” contains all parameters of the target database. It replaces the *.sqldeployment, *.sqlsettings and *.sqlcmdvars files.

You can create different profiles “sandbox, “INT”, “TEST”, “PROD” to use for all your environments. These profiles are saved in a xml file.

profile

3) Database project’s output : “*.dacpac

The build output of this project is a “*.dacpac” file instead of “.dbschema”

dacpac

4) SQLPackage.exe

SQLPackage.exe replaces VSDBCMD.exe.

You have to use the new comman line “SqlPackage.exe (http://msdn.microsoft.com/fr-fr/library/hh550080(v=vs.103).aspx) to deploy your database.

example :

SqlPackage /Action:Publish /SourceFile:”DatabaseProject.dacpac” /Profile:”PROD.publish.xml”

Local and Server Workspace in TFS 2012

One of new feature in TFS 2012 is the Local and Server workspace.

- Server is as the workspace from TFS 2010.

- Local workspace is new and allows to :

Work offline easily. You can quickly begin editing a file when your network connection is unavailable or unreliable. From Solution Explorer you can add, edit, delete, rename, undo, and compare items in your workspace even when you’re not connected to your Team Foundation Server.
Easily restore files that you have deleted locally. To restore locally deleted files, just get your files.
Visual Studio automatically detects changes. When you add or delete files outside of Visual Studio, the program automatically detects these changes.

The official link to the msdn website :
http://msdn.microsoft.com/en-us/library/bb892960.aspx

Microsoft Virtual Academy – Free Video Courses

I recommend this Virtual Academy by Microsoft. Virtual Academy provides free video courses about .Net, CSS, MVC, ALM, Windows 8… You can use it to prepare Microsoft Certifications.

http://www.microsoftvirtualacademy.com/product-training/product-visual-studio-fr#fbid=pKogXMMmsgo

Courses

 

 

TFS Integration Tools

The Microsoft Visual Studio TFS Integration Tools is a suite of tools that facilitate integration between external systems and Team Foundation Server. For more information visit this page or review the latest data sheet.

Download : http://tfsintegration.codeplex.com/releases/view/85498

How to delete an account from a TFS group with TFSSecurity.exe cmd

Sometime, we can’t remove user from TFS “Group Membership” Settings with “user Interface” directly.

Image

But you can remove with TFSSecurity.exe tool (http://msdn.microsoft.com/en-us/library/vstudio/ms252504.aspx) :

TFSSecurity.exe /g [GroupName] n:username /collection:collectionUrl /server:TFSServerName

  1. Use /server :servername /Collection :urlCollection …

Image

2. Result : “Done”

Image

TF293000: The data warehouse has detected data conflicts for the following work item fields

You can have this issue after the TFS 2010 Upgrade to TFS 2012

The solution is here :

http://msdn.microsoft.com/en-us/library/vstudio/ee921480.aspx

http://social.msdn.microsoft.com/Forums/vstudio/en-US/ece8824b-4d22-45d0-9ddd-7dd12676f424/tf293000-the-data-warehouse-has-detected-data-conflicts-for-the-following-work-item-fields

Follow

Get every new post delivered to your Inbox.