InsertColumn Method (SQL-DMO)

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

Applies To

Table Object

Syntax

object.InsertColumn( Column , InsertBeforeColumn )

Part Description
object Expression that evaluates to an object in the Applies To list
Column Expression that evaluates to a Column object
InsertBeforeColumn String naming an existing Column object in the Columns collection of a Table object

Remarks

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


Note 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 being used to create a SQL Server table.


Prototype (C/C++)

HRESULT InsertColumn(
LPSQLDMOCOLUMN pNewColumn,
SQLDMO_LPCSTR szBeforeColumn);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.