Share via


TSqlObject.GetScript Method

Definition

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).

Applies to