I am trying to automate the build/deploy process for our application through Teamcity. One of the steps I need to do through Teamcity is to run the .sql files on the databases. I am able to implement this step, however it runs all of the scripts each time which is very time consuming. I was wondering if there was a way to only run the updated/added .sql files (after running svn-update), or to only run the .sql files that were modified by a certain date, or something to that effect. The script I have now simply runs all sql files in the current directory (including subfolders).
for /R %%G in (*.sql) do sqlcmd /S server /U user /P password /d database -i"%%G"
So is there a way i could possibly tweak this, something like
for /R %%G in (*.sql) where date_modified > "1_28_2016" do sqlcmd /S server /U user /P password /d database -i"%%G"
Or am I way off track here? ANY feedback will help! Thanks!
NOTE: I believe a similar if not same question was asked on here before with almost no feedback that did not seem to work. I am posting again in hopes of finding an answer/reviving the question.