Created
September 13, 2018 11:07
-
-
Save Boggin/bb1ba90e986f9bb152c3dd4a4d228137 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module SqlServer | |
$srv = New-Object Microsoft.SqlServer.Management.Smo.Server("(local)") | |
$db = $srv.Databases.Item("IntermediaryManagement.DB") | |
$scrp = New-Object Microsoft.SqlServer.Management.Smo.Scripter($srv) | |
$scrp.Options.ScriptData = $TRUE | |
$scrp.Options.ScriptSchema = $FALSE | |
$tbl = $db.tables | Where-Object { $_.IsSystemObject -eq $FALSE } | |
$scrp.EnumScript(@($tbl)) | %{ Add-Content temp.sql $_ } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment