다음을 통해 공유


Synonym Class

The Synonym object represents a Microsoft SQL Server synonym.

네임스페이스: Microsoft.SqlServer.Management.Smo
어셈블리: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

구문

‘선언
Public NotInheritable Class Synonym
    Inherits ScriptSchemaObjectBase
    Implements IObjectPermission, ICreatable, IDroppable, IExtendedProperties, _
    IScriptable, IAlterable
public sealed class Synonym : ScriptSchemaObjectBase, IObjectPermission, ICreatable, IDroppable, 
    IExtendedProperties, IScriptable, IAlterable
public ref class Synonym sealed : public ScriptSchemaObjectBase, IObjectPermission, ICreatable, IDroppable, 
    IExtendedProperties, IScriptable, IAlterable
public final class Synonym extends ScriptSchemaObjectBase implements IObjectPermission, ICreatable, 
    IDroppable, IExtendedProperties, IScriptable, IAlterable
public final class Synonym extends ScriptSchemaObjectBase implements IObjectPermission, ICreatable, 
    IDroppable, IExtendedProperties, IScriptable, IAlterable

주의

업데이트된 텍스트:

The Synonym object provides programmatic access to synonyms. Synonyms can be used to create an alternative name for any SQL Server object.

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Inheritance Hierarchy

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

'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()

스레드 보안

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

플랫폼

개발 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

대상 플랫폼

지원되는 플랫폼 목록은 SQL Server 2005 설치를 위한 하드웨어 및 소프트웨어 요구 사항을 참조하십시오.

참고 항목

참조

Synonym Members
Microsoft.SqlServer.Management.Smo Namespace

관련 자료

How to: Create a Synonym in Visual Basic .NET
동의어 사용(데이터베이스 엔진)
Using Synonyms
CREATE SYNONYM(Transact-SQL)