x

Post-deploy command-line in database project?

Hello,

I have a database project in Visual Studio 2010. After the database is deployed (not after it is built) I want to execute a DOS command-line in the same way that can be done for the Post-build event.

Does anyone know how to do this?

more ▼

asked Jul 28, 2011 at 08:57 AM in Default

avatar image

xnl28
905 60 64 68

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

I believe the post-deployment scripts support SQLCMD syntax.

I haven't done this myself, but try calling the command line from your post deployment sql script

:!! <path-to-your-batch-file>

the list of commands supported by SQLCMD can be found in Books Online - http://msdn.microsoft.com/en-us/library/ms162773.aspx

more ▼

answered Jul 28, 2011 at 09:29 AM

avatar image

KenJ
24.8k 3 10 19

(comments are locked)
10|1200 characters needed characters left

You can define a post-deploy event in the project file, even though the GUI doesn't expose this. e.g.

 <PostDeployEvent>"$(MSBuildProjectDirectory)\BuildTools\mypostbuildtool.exe"</PostDeployEvent>
  
more ▼

answered Aug 13, 2012 at 07:29 PM

avatar image

craigfis
0

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x19
x5

asked: Jul 28, 2011 at 08:57 AM

Seen: 2254 times

Last Updated: Aug 13, 2012 at 07:29 PM

Copyright 2016 Redgate Software. Privacy Policy