Search code examples
sqlcmdsql-server-data-tools

SQLCMD include all scripts in folder


In my Post Deployment Script, I would like to include all script files in a folder using a wildcard like this: :r .\$(ReleaseName)\*.sql

Is there a way to do this? I can't find any..


Solution

  • I got it working:

    <MyFilesPath Include="$(ProjectDir)MyPath\*.sql"/>
    <MyFiles Include="@(MyFilesPath->':r %22..\Scripts\%(filename)%(extension)%22%0D%0A', '')"/>
    

    Then I include @MyFiles in my PostScript-file.