Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Management Studio SSMS tries to "save to file" instead of execute on F5

This happens intermittently and seems to be related to accidentally hitting a key.

Any ideas what causes this?

like image 701
MatthewMartin Avatar asked Oct 20 '22 07:10

MatthewMartin


People also ask

How to save results in SQL Server management studio (SSMS)?

The result displayed in SQL Server Management Studio (SSMS) is the following: If you want to save the results in a txt file, you can do this in SSMS. Go to Tools>Options : Select the option Result to file:

How do I export data from SSMS to a flat file?

In SSMS, when you right click a database. There is an option to import or export data. Go to Tasks>Export Data: You will open the SQL Server Import and Export wizard: We will export from SQL Server to a Flat file. Select the Microsoft OLE DB Provider as the Data Source: Specify the Server name and the connection information if necessary:

What happens when you double click on a SQLFile in SSMS?

When you double click on a .sqlfile, a new instance of SSMS is opened. I did not have this problem until new SQL Server Management Studio (SSMS 17.9.1) was installed.

How do I restore a database in SSMS?

To learn how to restore a database in SSMS, see Restoring a database. You can comment and uncomment portions of your text by using the Comment button on the toolbar. Text that is commented out is not executed. Open SQL Server Management Studio. Connect to your SQL server. Open a New Query window.


1 Answers

It sounds like you have accidentally changed from the default query option of "Results to Grid" to "Results to File". If that is the case it is easy to fix:

From the Query Menu -> Results To -> Results To Grid.

OR

Press Ctrl + D

Once you have tried one of the steps above, run your query again by pressing F5.

like image 278
Saul Dolgin Avatar answered Oct 22 '22 21:10

Saul Dolgin