x
login about faq Site discussion (meta-askssc)

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 '11 at 08:57 AM in Default

xnl28 gravatar image

xnl28
765 46 51 58

(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 '11 at 09:29 AM

KenJ gravatar image

KenJ
12.4k 2 10

(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 '12 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.

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



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x14
x3

asked: Jul 28 '11 at 08:57 AM

Seen: 1154 times

Last Updated: Aug 13 '12 at 07:29 PM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.