Run SQL script after deploy

mark.garcia's Avatar

mark.garcia

13 Nov, 2014 01:44 AM

Hi, Can anyone show how I can do this for .net framework?

Thanks

  1. Support Staff 1 Posted by Feodor Fitsner on 13 Nov, 2014 02:00 AM

    Feodor Fitsner's Avatar

    What deployment method do you use?

  2. 2 Posted by mark.garcia on 13 Nov, 2014 02:02 AM

    mark.garcia's Avatar

    We're using the appveyor agent for deployment.

  3. Support Staff 3 Posted by Feodor Fitsner on 13 Nov, 2014 02:21 AM

    Feodor Fitsner's Avatar

    You can put database update logic into deploy.ps1 script.
    Regarding the way of running SQL script - you can run bare SQL commands from PowerShell or try SSDT projects.aspx).

    A sample project for SSDT (it contains some test PS commands working with DB too):
    https://github.com/FeodorFitsner/dacpac-sample/blob/master/appveyor...

  4. 4 Posted by mark.garcia on 13 Nov, 2014 04:26 AM

    mark.garcia's Avatar

    Thank you, I tried to create a very basic ps to create a text after the deploy and I don't see the file created anywhere. I set it up under project > settings > deploy then choose ps under after deploy. Or should I just create a deploy.ps1 file?

  5. Support Staff 5 Posted by Feodor Fitsner on 13 Nov, 2014 04:27 AM

    Feodor Fitsner's Avatar

    Yeah, it should be deploy.ps1 in the root of your web application... and which is part of the project.

  6. 6 Posted by mark.garcia on 13 Nov, 2014 04:32 AM

    mark.garcia's Avatar

    Thank you so much. I'll do that then. thanks

  7. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 01:50 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac