SQL Management Studio Express opens SQL scripts in Notepad

When I go to File> Open> File and select a .sql script, or even when I drag and drop the .sql file into the SQL Management Studio Express window, it opens a script in Notepad, which is completely useless when I want to run a script.

Since this is located on an external server (Windows 2003 Server), I have to disable RDP, disable the local clipboard, reconnect, and then copy-paste the contents of the script from Textpad to start it.

I checked the options menu, but I see nothing related to Notepad, even in the "external tools" section. Any ideas why this will be done?

Please note: I checked the file association for SQL scripts and is configured for SQL Management Studio Express.

+5
source share
4 answers

Come here this morning. It turned out that this is an encoding problem for me. I opened the script in UltraEdit and I noticed that it shows that the encoding is U-DOS instead of DOS. I converted Unicode to ASCII (also to UltraEdit), saved the file, and now Management Studio opens the files correctly.

+8
source

I found this too - thanks to NFrank for spotting the problem:

This was caused by opening the script in TextPad and accidentally saving it as Unicode. The problem is not with file associations.

Solution: Open in Notepad (or TextPad) - Save as ... and select Encoding: ANSI

+6
source

UPDATE:

SQL Management Studio

Go to File > Open > File,  
Highlight a SQL file,  
Click the down arrow on the Open button.   
Select Open With... 
Select SQL Query Editor 
Press the Set as Default button.

Matt

+1

, , , , SQL , "".

0
source

All Articles