Associate File Extensions to a Code Editor
Associating file extensions to a specific code editor allows you to open a file with the appropriate SQL Server Management Studio code editor when you double-click a file in Windows Explorer. The extensions commonly used by Management Studio, such as .sql and .mdx, are associated during installation. New file extensions must also be associated to Management Studio in the file system. You can use this feature to open files created with other editors, or to open files you have renamed, such as backups of .sql files that were renamed .bak.
There are two steps in the process. First associate the extension with Management Studio, and then associate the extension with a specific code editor.
To associate a new file extension with SQL Server Management Studio
On the Start menu, point to All Programs, point to Accessories, and then click Windows Explorer.
In Windows Explorer, on the Tools menu, click Folder Options.
In the Folder Options dialog box, on the File Types tab, click New.
In the Create New Extension dialog box, in the File Extension box, type the new file extension that you want to associate, and then click OK. Do not start the extension with a period.
In the Registered file types box, click on your new extension, and then click Change.
In the Open With dialog box, click SSMS - SQL Server Management Studio, and then click OK.
Click Close to close the Folder Options dialog box, and then close Windows Explorer.
To associate a new file extension with a code editor in SQL Server Management Studio
In SQL Server Management Studio, from the Tools menu, click Options.
In the Options dialog box, click Text Editor, and then click File Extension.
In the Extension box, type your new file extension.
In the Editor box, click the code editor that you wish to use to open this file type, click Add, and then click OK.