Share via


Deploying MDS Samples in SQL Server 2012

[This post was created by Jason Howell, Senior Escalation Engineer in the SQL Server Support team specializing in MDS]

MDS ships 3 samples model packages in SQL Server 2012 (as of Release Candidate 0 timeframe) that you can use to show MDS and play around with the features.

image

The sample package files live under the SQL Server installation folder, for example the default location on 32-bit and 64-bit is

C:\Program Files\Microsoft SQL Server\110\Master Data Services\Samples\Packages

The readme.html has information on the format of each model’s entities.

Packages that do not contain data values can be deployed using the webpage System Administration / Deployment page in the browser.

However the 3 samples have some data values and can only be deployed with the command line tool, or you will get the error “The package file cannot be deployed because it contains data.“

Follow the advice in SQL Books Online https://msdn.microsoft.com/en-us/library/hh479646(SQL.110).aspx

The Syntax pattern for the tool is MDSModelDeploy.exe deploynew -package PackageName -model ModelName -service ServiceName

1. Launch cmd as administrator  Start > Cmd – right click. Run as Administrator. I did this on the server machine (not on a client machine).

2. Change into your SQL Folder:

Cd "C:\Program Files\Microsoft SQL Server\110\Master Data Services\Configuration"

3. List the MDS web services to connect to if you are unsure of the service name. The default being MDS1 as shown by this command.

MDSModelDeploy.exe listservices

image

4. Deploy the package by pointing to the package file, and connecting to that service listed from step #3. Provide a model name for the model that you want to deploy.

MDSModelDeploy.exe deploynew -package "C:\Program Files\Microsoft SQL Server\110\Master Data Services\Samples\Packages\customer_en.pkg" -model CustomerSample -service MDS1

MDSModelDeploy.exe deploynew -package "C:\Program Files\Microsoft SQL Server\110\Master Data Services\Samples\Packages\chartofaccounts_en.pkg" -model ChartOfAccountsSample -service MDS1

MDSModelDeploy.exe deploynew -package "C:\Program Files\Microsoft SQL Server\110\Master Data Services\Samples\Packages\product_en.pkg" -model ProductsSample -service MDS1

 

5. If your MDS users are in their browser windows, they may not immediately see the newly deployed models.

On the main MDS webpage, click the hyperlink over on the right that says “Refresh cached information” so that they get the latest list of models, and can explore the newly added sample models.

image

Then you can explore the newly deployed samples

 image

Just FYI - By comparison, for packages that don’t have data you can use the website deployment wizard. If the package has data inside it may fail as shown:

image

Then on the Sytem page, hover on the System menu and click deployment.

image

The web Deployment wizard will popup

image

Click Deploy and point to the file location. For example C:\Program Files\Microsoft SQL Server\110\Master Data Services\Samples\Packages

image

Next it will show if the package can be accessed and read.

image

Then click Next. Get an error… if it has data it will fail with the error shown.

image

The package file cannot be deployed because it contains data.

To deploy a package with data, use the MDSModelDeploy.exe tool.

Learn more about the MDSModelDeploy tool

Comments

  • Anonymous
    October 01, 2012
    Great information, thank you very much for sharing :-)

  • Anonymous
    November 24, 2012
    I saved a huge amount of time ... great work

  • Anonymous
    December 05, 2012
    nice article so far. But I have a problem. I could deploy the example packages with the given cmd command, but no other user can see the modell (Yes, did click on the refresh cached information link). :(

  • Anonymous
    December 05, 2012
    @Toffer - did you set up permissions on the new model for the existing users? I suppose the default is that the admin can see it, but probably users have to be added.

  • Anonymous
    February 03, 2013
    This is very good info, I was looking for exacly this!! Thanks for sharing.

  • Anonymous
    October 16, 2013
    Jason - Thanks for sharing.

  • Anonymous
    November 28, 2013
    A few simple steps, but it's a great help if someone who has done it before shares his experience. Many thanks!

  • Anonymous
    June 20, 2014
    Great info and very accessible read, Jason!

  • Anonymous
    August 13, 2015
    Interestingly you mentioned "By comparison, for packages that don’t have data you can use the website deployment wizard. If the package has data inside it MAY fail..." I was watching an yourtube video where it didn;t fail for the presenter but when I tried, it failed with the same error message. Is there any criteria which exists to not fail the deployment using Website depployment wizard, when data resides in model?

  • Anonymous
    September 02, 2016
    Great information, Thank You for sharing it.

  • Anonymous
    November 17, 2016
    Hi. I'm getting "The Microsoft sql server License has expired" error using the command:MDSModelDeploy.exe deploynew -package "C:\Program Files\Microsoft SQL Server\130\Master Data Services\Samples\Packages\customer_en.pkg" -model CustomerSample -service MDS1WDS running on win server 2012 R2, MSDN SQL server License.Any experience With this error ?

  • Anonymous
    May 15, 2017
    Crystal Clear! Thank you :)

  • Anonymous
    December 10, 2017
    Superb. It saved more google research :)Well Explained.