# Transfer.ps1 - Transfer objects between SQL Servers
#

$source = new-object ($smo + 'server') .
$db = $source.databases[$args[0]]
$t = new-object ($smo + 'transfer') $db
$t.CopyAllObjects = $true
$t.DropDestinationObjectsFirst = $true
$t.CopySchema = $true
$t.CopyData = $true
$t.DestinationServer = "."
$t.DestinationDatabase = "testdb"
$t.Options.IncludeIfNotExists = $true

# $t.transferdata()
# $strs = $t.scripttransfer()
# foreach ($str in $strs) { write-host $str }

$t.scripttransfer()
