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

xnl28 gravatar image

xnl28
895 56 60 61

(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][1]

[1]: http://msdn.microsoft.com/en-us/library/ms162773.aspx
more ▼

answered Jul 28, 2011 at 09:29 AM

KenJ gravatar image

KenJ
19.3k 1 3 11

(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

craigfis gravatar 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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:

x17
x3

asked: Jul 28, 2011 at 08:57 AM

Seen: 1783 times

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