We're modifying our continuous integration process to recreate databases before running unit tests. To my surprise, I can't actually open our scripts and feed them into a command and execute. We've actually had to start an osql process and feed them in
Does anyone know of a way to run sql scripts from a text file through ado.net?
not an answer to your specific question, I know, but I personally use NANT for environment rebuild/deploys. For integration testing (staging) the deploy is performed exactly as it would be when deploying the updates to production. A job gets kicked off
to refresh the test db with the latest copy of production. This way I am not only testing the new code when moving itinto the test environments, but also the deploy itself.
ie. clean local area, get latest from source control, tag/label source control, build solution, backup previous version, deploy new version to web, deploy latest scripts to db (pre-deploy scripts, functions, views, sprocs, post-deploy scripts).
For major deploys, a roll-back script is created and tested before production deploy takes place.
specifically how are the sql scripts run against the db?... here is an example from my script...
and then foreach the lines and then execute each line. if it has a value
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.