Usuwanie kolumny z tabeli programu SQL Server
SQL Server Udostępnia macierzystym klienta dostawca OLE DB ITableDefinition::DropColumn funkcja.Dzięki temu konsumenci usunąć kolumna z SQL Server tabela.
Consumers specify the table name as a Unicode character string in the pwszNamemember of the uName union in the pTableID parameter.The eKindmember of pTableID must be DBKIND_NAME.
The consumer indicates a column name in the pwszNamemember of the uName union in the pColumnID parameter.Nazwa kolumna jest znak Unicode ciąg.eKindelement członkowski pColumnID musi być DBKIND_NAME.
Przykład
Kod
DBID TableID;
DBID ColumnID;
HRESULT hr;
TableID.eKind = DBKIND_NAME;
TableID.uName.pwszName = L"MyTableName";
ColumnID.eKind = DBKIND_NAME;
ColumnID.uName.pwszName = L"MyColumnName";
hr = m_pITableDefinition->DropColumn(&TableID, &ColumnID);