SQL Server 2000: Create column descriptions via code 
Author Message
 SQL Server 2000: Create column descriptions via code

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



Tue, 18 Nov 2003 16:21:49 GMT  
 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



Thu, 20 Nov 2003 23:43:27 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Executing MS SQL Server 2000 stored procs via MS Access 2000

2. Creating and Configuring a SQL Server Database via Code

3. Access 2000 VBA/SQL - cannot create pseudo-index on linked SQL Server table

4. SQL Server Column Descriptions

5. SQL Server column description

6. SQL Server Field Descriptions and Microsoft Access Field Descriptions

7. VB6 application using SQL Server 2000 migrating db to SQL Server 2

8. How to code login SQL Server from Access 2000 project

9. Using SQLXML created by SQL Server 2000

10. Secure VB & SQL Server 2000 code

11. Creating Listview columns via code

12. VB Sql Server Via ADO Problem: [Microsoft][ODBC Sql Server Driver]

 

 
Powered by phpBB® Forum Software