تحرير

مشاركة عبر


Associate file extensions with a code editor

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW)

When you associate file extensions with a specific code editor, you can open a file by double-clicking it in File Explorer and it opens in the appropriate Management Studio (SSMS) code editor.

The SSMS installation process associates common extensions it uses, such as .sql and .mdx. To associate new file extensions with SSMS, you must do so in the file system. Use this feature to open files created with other editors or to open files you renamed, such as backups of .sql files that you renamed .bak.

The process has two steps. First, associate the extension with SSMS. Then, associate the extension with a specific code editor.

Associate a new file extension with SQL Server Management Studio

  1. Open Windows Settings: Select the Start menu and select Settings.

  2. Navigate to Default Apps: In the Settings window, select Apps, and then select Default apps.

  3. Choose Default Apps by File Type: Scroll down and select Choose default apps by file type.

  4. Find Your File Extension: Locate the file extension you want to associate (for example, .sql).

  5. Set SSMS as Default: Select the current default app and select SQL Server Management Studio from the list.

  6. Configure within SSMS: Open SSMS, go to Tools > Options, and under Text Editor, specify the editor for the new extension if necessary.

Associate a new file extension with a code editor in SQL Server Management Studio

  1. In SQL Server Management Studio, from the Tools menu, select Options.

  2. In the Options dialog box, select Text Editor, and then select File Extension.

  3. In the Extension box, type your new file extension.

  4. In the Editor box, select the code editor that you want to use to open this file type, select Add, and then select OK.