hi friends!
Suppose, i have a query:
SELECT fname AS Firstname, lname AS Lastname FROM Customer
Now is it possible to get the column names produced by the above query? Like
Firstname
Lastname
just like we extract column names from information_schema.columns for a table name?
with regards,
Buragohain
|||Hi friends!
Thanx everyone for your response.
By creating a temporary table using the query, then accessing the columns, and then deleting the temporary table, will solve the problem. But i wonder is there any in-built technique is Sql server for that or not. Like:
exec sp_columns 'Customer'
exec sp_columns 'select * from Customer' (wrong)
exec sp_columns 'SELECT fname AS Firstname, lname AS Lastname FROM Customer' (wrong)
Again, if there is any technique in ADO.NET, then it will be helpfull too.
(my problem was to show friendly column names to end user from several tables joined.)
with regards,
No comments:
Post a Comment