This happens intermittently and seems to be related to accidentally hitting a key.
Any ideas what causes this?
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:
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:
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With