See Also

Region Members  | RedGate.SQLCompare.Engine Namespace

Requirements

Namespace: RedGate.SQLCompare.Engine

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: RedGate.SQLCompare.Engine (in RedGate.SQLCompare.Engine.dll)

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Requirements Languages RedGate.SQLCompare.Engine Send comments on this topic.

Region Class

RedGate.SQLCompare.Engine Namespace : Region Class

A region of text.

For a list of all members of this type, see Region members.

Inheritance Hierarchy

System.Object
   RedGate.SQLCompare.Engine.Region

Syntax

[Visual Basic]
Public Class Region
[C#]
public class Region
[C++]
public __gc class Region
[C++/CLI]
public ref class Region

Remarks

The script for a SQL object is returned as a collection of regions. For example, the SQL script for a table might contain regions for columns, constraints, indexes, foreign keys, and permissions.

Use ToString to view the entire SQL script.

Example

Viewing the SQL script to create a table.

[C#] 

Database db=new Database(); 
  
db.Register(new ConnectionProperties(".", "WidgetStaging"), Options.Default); 
  
Work work=new Work(); 
  
//get the script for an object 
Regions regions=work.ScriptObject(db.Tables[0], Options.Default); 
  
Console.WriteLine("Entire SQL script:\n{0}", regions.ToString()); 
  
Console.WriteLine("By region:\n"); 
  
foreach (Region region in regions) 

    Console.WriteLine("***{0}", region.Name); 
    Console.WriteLine(region.SQL); 

  
db.Dispose(); 
    

[Visual Basic] 

Dim db As New Database()

db.Register(New ConnectionProperties(".", "WidgetStaging"), Options.Default)

Dim work As New Work()

'get the script for an object

Dim regions As Regions = work.ScriptObject(db.Tables(0), Options.Default)

Console.WriteLine("Entire SQL script:")
Console.WriteLine("{0}", regions.ToString())

Dim region As Region

For Each region In regions
    Console.WriteLine("***{0}", region.Name)
    Console.WriteLine(region.SQL)
Next

'dispose
db.Dispose()

Requirements

Namespace: RedGate.SQLCompare.Engine

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: RedGate.SQLCompare.Engine (in RedGate.SQLCompare.Engine.dll)

See Also

Region Members  | RedGate.SQLCompare.Engine Namespace

 

 


© 2003 - 2007 Red Gate Software Ltd. All Rights Reserved.