Synonym Class
The Synonym object represents a Microsoft SQL Server synonym.
Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)
System.Object
Microsoft.SqlServer.Management.Smo.SmoObjectBase
Microsoft.SqlServer.Management.Smo.SqlSmoObject
Microsoft.SqlServer.Management.Smo.NamedSmoObject
Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
Microsoft.SqlServer.Management.Smo.ScriptSchemaObjectBase
Microsoft.SqlServer.Management.Smo.Synonym
Microsoft.SqlServer.Management.Smo.SmoObjectBase
Microsoft.SqlServer.Management.Smo.SqlSmoObject
Microsoft.SqlServer.Management.Smo.NamedSmoObject
Microsoft.SqlServer.Management.Smo.ScriptNameObjectBase
Microsoft.SqlServer.Management.Smo.ScriptSchemaObjectBase
Microsoft.SqlServer.Management.Smo.Synonym
'Connect to the local, default instance of SQL Server. Dim srv As Server srv = New Server() 'Reference the AdventureWorks database. Dim db As Database db = srv.Databases("AdventureWorks") 'Define a Synonym object variable by supplying the parent database, name, and schema arguments in the constructor. 'The name is also a synonym of the name of the base object. Dim syn As Synonym syn = New Synonym(db, "Shop", "Sales") 'Specify the base object, which is the object on which the synonym is based. syn.BaseDatabase = "AdventureWorks" syn.BaseSchema = "Sales" syn.BaseObject = "Store" syn.BaseServer = srv.Name 'Create the synonym on the instance of SQL Server. syn.Create()
Development Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.Target Platforms
For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.