Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

How use "Description" as a column name

$
0
0

hello I want use "Description property" as a column name.

like

Select * as [their Description property] from myTabI 


I Find this code for getting "Description property"  of each column

   select 
        st.name [Table],
        sc.name [Column],
        sep.value [Description]
    from sys.tables st
    inner join sys.columns sc on st.object_id = sc.object_id
    left join sys.extended_properties sep on st.object_id = sep.major_id
                                         and sc.column_id = sep.minor_id
                                         and sep.name = 'MS_Description'

But I don't konw how can I use it as a dynamic name  for a column

thanks for your time


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>