SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Query to Excel Stored Procedure


Query to Excel Stored Procedure

Author
Message
Darko Martinovic
Darko Martinovic
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3097 Visits: 737
Comments posted to this topic are about the item Query to Excel Stored Procedure
Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)SSC Guru (142K reputation)

Group: General Forum Members
Points: 142904 Visits: 22077
Nice piece Darko, thank you for this!
Cool
jbowers
jbowers
SSC Veteran
SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)SSC Veteran (265 reputation)

Group: General Forum Members
Points: 265 Visits: 249
Darko, nice article with lots of great detail. I thought this might give me a 4th option for my query results; Results to Text, Results to Grid, Results to File, and now... Results to Excel?!? When I got to the line "...SpreadSheetGear is commercial software that cannot be distributed without license", I popped over to https://www.spreadsheetgear.com/downloads/purchase.aspx to learn that their licenses go for $999. I can buy an Excel license for $129.99, which got me thinking, "Why would I ever want to do this instead of just copying the query results from the SSMS grid and pasting it into a blank Excel workbook, where I can then manipulate it further?"

I was intrigued by the premise, which is why I read the article. You did a great job of documenting all of the of very detailed steps required to make this work. But I'm curious as to what you think the real-world application of this technique would be.
robert.sterbal 56890
robert.sterbal 56890
SSCertifiable
SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)SSCertifiable (7.8K reputation)

Group: General Forum Members
Points: 7821 Visits: 1550
jbowers - Monday, March 5, 2018 9:12 AM
Darko, nice article with lots of great detail. I thought this might give me a 4th option for my query results; Results to Text, Results to Grid, Results to File, and now... Results to Excel?!? When I got to the line "...SpreadSheetGear is commercial software that cannot be distributed without license", I popped over to https://www.spreadsheetgear.com/downloads/purchase.aspx to learn that their licenses go for $999. I can buy an Excel license for $129.99, which got me thinking, "Why would I ever want to do this instead of just copying the query results from the SSMS grid and pasting it into a blank Excel workbook, where I can then manipulate it further?"

I was intrigued by the premise, which is why I read the article. You did a great job of documenting all of the of very detailed steps required to make this work. But I'm curious as to what you think the real-world application of this technique would be.

The reviews of Excel 2016 were comically bad. Wow.

patrickmcginnis59 10839
patrickmcginnis59 10839
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17018 Visits: 7609
jbowers - Monday, March 5, 2018 9:12 AM
Darko, nice article with lots of great detail. I thought this might give me a 4th option for my query results; Results to Text, Results to Grid, Results to File, and now... Results to Excel?!? When I got to the line "...SpreadSheetGear is commercial software that cannot be distributed without license", I popped over to https://www.spreadsheetgear.com/downloads/purchase.aspx to learn that their licenses go for $999. I can buy an Excel license for $129.99, which got me thinking, "Why would I ever want to do this instead of just copying the query results from the SSMS grid and pasting it into a blank Excel workbook, where I can then manipulate it further?"

I was intrigued by the premise, which is why I read the article. You did a great job of documenting all of the of very detailed steps required to make this work. But I'm curious as to what you think the real-world application of this technique would be.


I rated this article a 1 based on the licensing price.

to properly post on a forum:http://www.sqlservercentral.com/articles/61537/
Darko Martinovic
Darko Martinovic
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3097 Visits: 737
Eirikur Eiriksson - Monday, March 5, 2018 8:33 AM
Nice piece Darko, thank you for this!
Cool


Thank you Eirikur Smile
Darko Martinovic
Darko Martinovic
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3097 Visits: 737
jbowers - Monday, March 5, 2018 9:12 AM
Darko, nice article with lots of great detail. I thought this might give me a 4th option for my query results; Results to Text, Results to Grid, Results to File, and now... Results to Excel?!? When I got to the line "...SpreadSheetGear is commercial software that cannot be distributed without license", I popped over to https://www.spreadsheetgear.com/downloads/purchase.aspx to learn that their licenses go for $999. I can buy an Excel license for $129.99, which got me thinking, "Why would I ever want to do this instead of just copying the query results from the SSMS grid and pasting it into a blank Excel workbook, where I can then manipulate it further?"

I was intrigued by the premise, which is why I read the article. You did a great job of documenting all of the of very detailed steps required to make this work. But I'm curious as to what you think the real-world application of this technique would be.

The solution could be incorporated in SQL Server Agent jobs.For example, when you have to generate an Excel file without starting SSMS.

Of course, there is a situation when you have to copy &paste, many times.
I met many people their job is to copy and paste query results many times daily and do some basic Excel formatting.It is easy when Excel file contains only one sheet, but when contains ten or twelve, copying and pasting does not make sense.

Of course, there is no sense to bay a license, only for consuming ‘Query To Excel’ stored procedure. If you are already licensed, for.NET developing, you might consider what I write above.

Btw, there is an option to transform a query result to HTML which is described in my article

http://www.sqlservercentral.com/articles/SQLCLR/156474/


Darko Martinovic
Darko Martinovic
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3097 Visits: 737
robert.sterbal 56890 - Monday, March 5, 2018 10:54 AM
jbowers - Monday, March 5, 2018 9:12 AM
Darko, nice article with lots of great detail. I thought this might give me a 4th option for my query results; Results to Text, Results to Grid, Results to File, and now... Results to Excel?!? When I got to the line "...SpreadSheetGear is commercial software that cannot be distributed without license", I popped over to https://www.spreadsheetgear.com/downloads/purchase.aspx to learn that their licenses go for $999. I can buy an Excel license for $129.99, which got me thinking, "Why would I ever want to do this instead of just copying the query results from the SSMS grid and pasting it into a blank Excel workbook, where I can then manipulate it further?"

I was intrigued by the premise, which is why I read the article. You did a great job of documenting all of the of very detailed steps required to make this work. But I'm curious as to what you think the real-world application of this technique would be.

The reviews of Excel 2016 were comically bad. Wow.

Americans used to write TL;DR when the article is a little bit longer.
I'm sorry your expectation is not fulfilled.
But is a compromise.
For those who are interested in the topic is quite enough.
IMO it is not realistic to expect that SSC will teach you Excel or SSG object model.


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search