mcintyre321的链接看起来得心应手......
我用PowerShell中做同样的事情。我会按照他们需要编译的顺序,用前缀和1.x命名我的所有设置脚本。
然后我以正确的顺序将所有拆卸脚本命名为3.x。
在cmd窗口的命令:
PS builddir:\> .\buildsql.ps1 -currentbuilddir "C:\Documents and Settings\SGreene\My Documents\svn\Ticketing" -buildfile "sqlbuild.sql" -teardownfile
"teardown.sql"
PowerShell脚本(buildsql.ps1)
param($currentbuilddir,$buildfile1,$teardownfile)
new-psdrive -name builddir -PSProvider filesystem -Root (resolve-path $currentbuilddir)
cd builddir:
rm $buildfile1
rm $teardownfile
Get-item COM_ENCRYPT_1* | ForEAch-object {cat $_ >> $buildfile1; "GO --SYSTEM INSERTED GO--------------" >> $buildfile1}
Get-item COM_ENCRYPT_3* | ForEAch-object {cat $_ >> $teardownfile; "GO --SYSTEM INSERTED GO------------" >> $teardownfile}
我第一次这样做,但它似乎工作确定。
来源
2010-01-25 19:09:36
Sam
忘记补充说我正在使用SQL Server Management Studio Express创建和运行脚本。 – Belliez 2010-01-25 16:41:00