TSqlObject.GetScript Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Generates a CREATE script from the objects AST. AST generation is only supported for top-level objects, with certain objects such as the DatabaseOptions and inline constraints not supporting AST generation even though they are top level types. If it's unknown whether the object is capable of being scripted then the TryGetAst(TSqlScript) method should be used instead.
public string GetScript ();
member this.GetScript : unit -> string
Public Function GetScript () As String
Returns
DDL Creation script
Exceptions
If TSqlObject is not a top level statement object or if it does not support script generation (for example if it is a DatabaseOptions or a constraint that was originally defined inline with a Table).