Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy only column header from resultset in microsoft sql server management studio

I want to copy only 'Column Headers' from the result set in Microsoft Sql Server Management Studio but I didn't find any option. Same option is there is Oracle SQL server management. I googled about it but didn't find any thing that would help me so wanted to check if there a way to do this

like image 481
Ashishkumar Singh Avatar asked Sep 18 '25 08:09

Ashishkumar Singh


2 Answers

Run your query without any result-set using select * from tablename where 1=2

then use "Copy with Header".This is the only way to copy only columns header.

like image 200
Nitika Avatar answered Sep 19 '25 22:09

Nitika


Instead of result into grid please use Result to text. Result to Text - Ctrl+3

Hope this helps.

like image 41
Dhaval Mehta Avatar answered Sep 19 '25 21:09

Dhaval Mehta