共用方式為


InsertColumn Method

未來的 Microsoft SQL Server 發行版本將不再提供此功能。請避免在新的開發工作中使用此功能,並計劃修改目前使用此功能的應用程式。

The InsertColumn method adds a column to the Columns collection of a Table object at the position indicated.

語法

object
.InsertColumn(
Column
,
InsertBeforeColumn
)

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Column
    Expression that evaluates to a Column object.
  • InsertBeforeColumn
    String that names an existing Column object in the Columns collection of a Table object.

Prototype (C/C++)

HRESULT InsertColumn(
LPSQLDMOCOLUMN pNewColumn,
SQLDMO_LPCSTR szBeforeColumn);

備註

Use the InsertColumn method when the ordinal position of a column must be maintained.

ms136870.note(zh-tw,SQL.90).gif附註:
Columns in existing Microsoft SQL Server tables have fixed ordinal location. You cannot use the InsertColumn method when the Table object references an existing SQL Server table. Use InsertColumn only when the Table object is used to create a SQL Server table.

Applies To:

Table Object