Question: how to export data from sql server to excel using t sql?
Answer: Open SQL Server Management Studio and connect to the database.
Go to "Object Explorer", find the server database you want to export to Excel. ... 
Now, you need to click on the Data source drop-down button to choose the data source you want to copy.