0

I know you can export SQL Server results to Excel, however is there a way for the procedure to pop up a window and ask the user for a file name and location or does the file name and location have to be defined in the stored procedure for it to work properly?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
mfoehrer
  • 35
  • 8
  • 3
    A stored procedure is not a UI. What you are talking about is what an application might do. Think of a stored procedure like a dll. It is simply a black box that can do some stuff for you. It has no user interface of any kind. You could however use your front end application to ask the user and you could pass that location to your stored procedure as a parameter. – Sean Lange Jan 20 '17 at 21:39

1 Answers1

0

What you're looking for is INSERT INTO OPENROWSET. Here's the MSDN article. Check out this SO Q&A for usage.

Community
  • 1
  • 1
SQL_Deadwood
  • 491
  • 5
  • 14