Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Getting Sqlserver Views- Coloumname and Alies name

Author  Topic 

mgnnet
Starting Member

2 Posts

Posted - 2010-08-06 : 03:22:59
hi
I need to take sqlserver 2005 views coloumname and alies name both i have to take pls help me..

thanks

Sachin.Nand

2937 Posts

Posted - 2010-08-06 : 05:57:02
[code]
select v.name as ViewName,c.name as ColumnName
from YourDB.sys.views v
inner join YourDB.sys.syscolumns c on c.id=v.object_id
where v.name='yourviewname'
[/code]


Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless.

PBUH
Go to Top of Page

mgnnet
Starting Member

2 Posts

Posted - 2010-08-06 : 06:46:02
hi thanks for quick reply..

It return viewname and alias name... I need actual column and alias name

thanks again
Go to Top of Page
   

- Advertisement -