Recently i read an interesting question on SQLServerCentral.com, with main point that what function we can use to get just meta data instead of associated data from a T-SQL statement. It is interesting. After submitting my reply (which was accidentally correct), i read the provided BOL link and came to know that SET FMTONLY on or Off, we may getjust meta data instead of associated data through a T-SQL command. For example consider the impact of using this function
Use AdventureWorks GO SET FMTONLY ON GO SELECT * FROM production.Document GO SET FMTONLY off GO
And instead of retreiving whole data, i just got name of columns from my script. You may use it on SQL Srever 2000, SQL Server 2005 and SQL Server 2008. You require membership of Public role to use this function.