Alter Method

后续版本的 Microsoft SQL Server 将删除该功能。 请避免在新的开发工作中使用该功能,并着手修改当前还在使用该功能的应用程序。

The Alter method changes the definition of the referenced stored procedure, trigger, user-defined function, or view.

语法

object.Alter(str)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.

  • str
    String that specifies a Transact-SQL command batch for referenced object creation.

Prototype (C/C++)

HRESULT Alter(SQLDMO_LPCSTR NewValue);

注释

Microsoft SQL Server supports modifications to the definition of existing objects by using the Transact-SQL ALTER FUNCTION, ALTER PROCEDURE, ALTER TRIGGER, and ALTER VIEW statements. SQL Distributed Management Objects (SQL-DMO) implements execution of these statements through the Alter method of StoredProcedure, Trigger, and View objects.

Modifying a SQL Server database object by using the Alter method requires appropriate permissions. The SQL Server login used for SQLServer object connection must be mapped to a database user identified as the object owner or a member of a role with greater permissions.