cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
admiral70
New Member

Include Header data from SQL Server Connection to Excel

I have built an automation that connects to a SQL database, runs a query, launches Excel, writes query results to Excel, closes and saves to a file. This all works except I am not pulling in the header data from the query.  Any ideas?

 

Any help is greatly appreciated. 

1 REPLY 1
MichaelAnnis
Super User
Super User

95B63F0C-A581-4354-9F31-F394E5C37FC5.jpeg

 The property for the Column Names is %.ColumnsNames%.

You should be able to pull these into a variable from %DataTable.ColumnsNames% where %DataTable% is your SQL Result variable. 

Once you have isolated them, try to write them back your excel file.  I don’t deal with SQL, but this should point you in the right direction. 

Best of Luck!

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Top Solution Authors
Users online (3,327)