2

I have a database project in Visual Studio and when I deploy it creates a series of scripts and executes them. The scripts seem to be tied to Visual Studio deployment though. I would like to be able to take the script and execute it in SQL Server Management Studio on the server. Is this possible?

2
  • @Tushar - I will keep an eye out.
    – Craig
    Mar 11, 2011 at 9:53
  • I myself have been annoyed by the missing functionality in Visual Studio 2010. I have looked at various options/alternative to manage and deploy the scripts on the server, but nothing was as easy as it was in Visual Studio 2008.
    – Tushar
    Apr 18, 2011 at 6:51

1 Answer 1

1

Yes, it is possible to run the deployment TSQL script directly (although there may be some parameters required), but you would normally do this using VSDBCmd:

GDR comes with a command-line tool called VSDBCmd (vsdbcmd.exe). This tool can create a .dbschema file from an existing database and deploy a build output or only a .dbschema file to a target instance. VSDBCmd can also be used on a computer on which Visual Studio is not installed. To move the command-line tool from one computer to another, copy the executable and its components from the Deploy directory under the VSTSDB directory. In a standard Visual Studio installation, this will be "%programfiles%\microsoft visual studio 9.0\vstsdb\deploy. The Deploy directory can be copied onto a thumb-drive and then placed on another computer.

Ref: Introducing New Features In The VSTS Database Edition GDR

3
  • This is good, but doesn't really fulfill the requirement to run the scripts in SSMS.
    – Craig
    Dec 9, 2011 at 0:20
  • @Craig: suggest you take it up with Microsoft! Or you could supply those parameters yourself usinge setvar (there are only a handful) Dec 9, 2011 at 0:27
  • Normally I just doctor the script like you say. It is pretty easy but would be good to have an option to not need to.
    – Craig
    Dec 9, 2011 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.