
SQL Server 2000: Create column descriptions via code
Mathias,
From SS2K Books Online for sp_addextendedproperty:
This example adds the property ('caption,' 'Employee ID') to column 'ID' in
table 'T1.'
CREATE table T1 (id int , name char (20))
GO
EXEC sp_addextendedproperty 'caption', 'Employee ID', 'user', dbo,
'table', T1, 'column', id
--
HTH,
Alexander Shirshov, MCSD
Quote:
> Hi,
> how can I add a description to a column in SQL Server 2000? This is no
> problem with the Enterprise Manager, but how to do this via code? I need
to
> read the tables of a Access database (no big problem) and then create
> (nearly) identical tables with keys, indicies, data and even column
> descriptions in SQL server. I don't belong to OLEDB or ODBC here, I just
> need to get this to work!
> ps. I found a property named DBPROP_COL_DESCRIPTION and the information,
> that this property isn't implemented in SQL OLEDB driver (version/date of
> this info unknown, maybe MDAC 2.5 or earlier), but unfortunatly nothing
> about how to use this.
> Thanks,
> Mathias