ADD-pssnapin SqlServerCmdletSnapin100
$ServerName = "MySERVER"
$Db = "MyDB"
$scriptDir = "c:\FileDir\"
$files = gci $scriptDir* -include *.sql
foreach ($file IN $files)
{
Invoke-Sqlcmd -ServerInstance $ServerName -DATABASE $Db -InputFile $File
}
No comments:
Post a Comment