Skip to content

Commit d26479c

Browse files
author
stevestein
committed
moving scripting articles to SSMS node
1 parent c639b1a commit d26479c

93 files changed

Lines changed: 6757 additions & 6755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/relational-databases/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
- name: Linked servers +
156156
href: ../relational-databases/linked-servers/linked-servers-database-engine.md
157157
- name: Scripting +
158-
href: ../relational-databases/scripting/database-engine-scripting.md
158+
href: ../ssms/scripting/database-engine-scripting.md
159159
- name: Full-text Search +
160160
href: ../relational-databases/search/full-text-search.md
161161
- name: Subqueries +

docs/relational-databases/scripting/add-transact-sql-snippets.md renamed to docs/ssms/scripting/add-transact-sql-snippets.md

Lines changed: 113 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,113 @@
1-
---
2-
title: "Add Transact-SQL Snippets | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "03/14/2017"
5-
ms.prod: sql
6-
ms.prod_service: "sql-tools"
7-
ms.technology: scripting
8-
ms.reviewer: ""
9-
ms.topic: conceptual
10-
ms.assetid: 901c7995-8eb5-4d12-8bb0-de0a922b48f8
11-
author: MightyPen
12-
ms.author: genemi
13-
manager: craigg
14-
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
15-
---
16-
# Add Transact-SQL Snippets
17-
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
18-
You can add your own Transact-SQL code snippets to the set of pre-defined snippets included in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
19-
20-
## Creating a Transact-SQL Snippet File
21-
The first part of creating a [!INCLUDE[tsql](../../includes/tsql-md.md)] code snippet is to create an XML file with the text of your code snippet. The file must have a .snippet file extension, and meet the requirements of the [Code Snippets Schema](http://go.microsoft.com/fwlink/?LinkId=207504). Set the snippet language to SQL.
22-
23-
You can use the pre-defined snippets that ship with [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] as examples. To find the pre-defined snippets, open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], select the **Tools** menu, and click **Code Snippet Manager**. Select **SQL** in the **Language** list box, the path to the [!INCLUDE[tsql](../../includes/tsql-md.md)] snippets is displayed in the **Location** box.
24-
25-
## Registering the Code Snippet
26-
After creating the snippet file, use the Code Snippets Manager to register the snippet with [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]. You can either add a folder containing multiple snippets, or import individual snippets to the **My Code Snippets** folder.
27-
28-
## Procedures
29-
30-
#### Adding a Snippet Folder
31-
32-
1. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
33-
34-
2. Select the **Tools** menu, and click **Code Snippets Manager**.
35-
36-
3. Click the **Add** button.
37-
38-
4. Navigate to the folder containing your code snippets, and click the **Select Folder** button.
39-
40-
#### Importing a Snippet
41-
42-
1. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
43-
44-
2. Select the **Tools** menu, and click **Code Snippets Manager**.
45-
46-
3. Click the **Import** button.
47-
48-
4. Navigate to the folder containing your snippet, click on the .snippet file, and click the **Open** button.
49-
50-
## Examples
51-
The following example creates a **TRY-CATCH** surround-with snippet and imports it to [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
52-
53-
1. Paste the following code into notepad, then save as a file named TryCatch.snippet.
54-
55-
```
56-
<?xml version="1.0" encoding="utf-8" ?>
57-
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
58-
<_locDefinition xmlns="urn:locstudio">
59-
<_locDefault _loc="locNone" />
60-
<_locTag _loc="locData">Title</_locTag>
61-
<_locTag _loc="locData">Description</_locTag>
62-
<_locTag _loc="locData">Author</_locTag>
63-
<_locTag _loc="locData">ToolTip</_locTag>
64-
<_locTag _loc="locData">Default</_locTag>
65-
</_locDefinition>
66-
<CodeSnippet Format="1.0.0">
67-
<Header>
68-
<Title>TryCatch</Title>
69-
<Shortcut></Shortcut>
70-
<Description>Example Snippet for Try-Catch.</Description>
71-
<Author>SQL Server Books Online Example</Author>
72-
<SnippetTypes>
73-
<SnippetType>SurroundsWith</SnippetType>
74-
</SnippetTypes>
75-
</Header>
76-
<Snippet>
77-
<Declarations>
78-
<Literal>
79-
<ID>CatchCode</ID>
80-
<ToolTip>Code to handle the caught error</ToolTip>
81-
<Default>CatchCode</Default>
82-
</Literal>
83-
</Declarations>
84-
<Code Language="SQL"><![CDATA[
85-
BEGIN TRY
86-
87-
$selected$ $end$
88-
89-
END TRY
90-
BEGIN CATCH
91-
92-
$CatchCode$
93-
94-
END CATCH;
95-
]]>
96-
</Code>
97-
</Snippet>
98-
</CodeSnippet>
99-
</CodeSnippets>
100-
```
101-
102-
2. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
103-
104-
3. Select the **Tools** menu, and click **Code Snippets Manager**.
105-
106-
4. Click the **Import** button.
107-
108-
5. Navigate to the folder containing TryCatch.snippet, click on the TryCatch.snippet file, and click the **Open** button. You should not have a TryCatch snippet in your **My Code Snippets** folder.
109-
110-
## See Also
111-
[Insert Surround-with Transact-SQL snippets](../../relational-databases/scripting/insert-surround-with-transact-sql-snippets.md)
112-
113-
1+
---
2+
title: "Add Transact-SQL Snippets | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/14/2017"
5+
ms.prod: sql
6+
ms.prod_service: "sql-tools"
7+
ms.technology: scripting
8+
ms.reviewer: ""
9+
ms.topic: conceptual
10+
ms.assetid: 901c7995-8eb5-4d12-8bb0-de0a922b48f8
11+
author: MightyPen
12+
ms.author: genemi
13+
manager: craigg
14+
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
15+
---
16+
# Add Transact-SQL Snippets
17+
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
18+
You can add your own Transact-SQL code snippets to the set of pre-defined snippets included in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)].
19+
20+
## Creating a Transact-SQL Snippet File
21+
The first part of creating a [!INCLUDE[tsql](../../includes/tsql-md.md)] code snippet is to create an XML file with the text of your code snippet. The file must have a .snippet file extension, and meet the requirements of the [Code Snippets Schema](http://go.microsoft.com/fwlink/?LinkId=207504). Set the snippet language to SQL.
22+
23+
You can use the pre-defined snippets that ship with [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] as examples. To find the pre-defined snippets, open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], select the **Tools** menu, and click **Code Snippet Manager**. Select **SQL** in the **Language** list box, the path to the [!INCLUDE[tsql](../../includes/tsql-md.md)] snippets is displayed in the **Location** box.
24+
25+
## Registering the Code Snippet
26+
After creating the snippet file, use the Code Snippets Manager to register the snippet with [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]. You can either add a folder containing multiple snippets, or import individual snippets to the **My Code Snippets** folder.
27+
28+
## Procedures
29+
30+
#### Adding a Snippet Folder
31+
32+
1. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
33+
34+
2. Select the **Tools** menu, and click **Code Snippets Manager**.
35+
36+
3. Click the **Add** button.
37+
38+
4. Navigate to the folder containing your code snippets, and click the **Select Folder** button.
39+
40+
#### Importing a Snippet
41+
42+
1. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
43+
44+
2. Select the **Tools** menu, and click **Code Snippets Manager**.
45+
46+
3. Click the **Import** button.
47+
48+
4. Navigate to the folder containing your snippet, click on the .snippet file, and click the **Open** button.
49+
50+
## Examples
51+
The following example creates a **TRY-CATCH** surround-with snippet and imports it to [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
52+
53+
1. Paste the following code into notepad, then save as a file named TryCatch.snippet.
54+
55+
```
56+
<?xml version="1.0" encoding="utf-8" ?>
57+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
58+
<_locDefinition xmlns="urn:locstudio">
59+
<_locDefault _loc="locNone" />
60+
<_locTag _loc="locData">Title</_locTag>
61+
<_locTag _loc="locData">Description</_locTag>
62+
<_locTag _loc="locData">Author</_locTag>
63+
<_locTag _loc="locData">ToolTip</_locTag>
64+
<_locTag _loc="locData">Default</_locTag>
65+
</_locDefinition>
66+
<CodeSnippet Format="1.0.0">
67+
<Header>
68+
<Title>TryCatch</Title>
69+
<Shortcut></Shortcut>
70+
<Description>Example Snippet for Try-Catch.</Description>
71+
<Author>SQL Server Books Online Example</Author>
72+
<SnippetTypes>
73+
<SnippetType>SurroundsWith</SnippetType>
74+
</SnippetTypes>
75+
</Header>
76+
<Snippet>
77+
<Declarations>
78+
<Literal>
79+
<ID>CatchCode</ID>
80+
<ToolTip>Code to handle the caught error</ToolTip>
81+
<Default>CatchCode</Default>
82+
</Literal>
83+
</Declarations>
84+
<Code Language="SQL"><![CDATA[
85+
BEGIN TRY
86+
87+
$selected$ $end$
88+
89+
END TRY
90+
BEGIN CATCH
91+
92+
$CatchCode$
93+
94+
END CATCH;
95+
]]>
96+
</Code>
97+
</Snippet>
98+
</CodeSnippet>
99+
</CodeSnippets>
100+
```
101+
102+
2. Open [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)].
103+
104+
3. Select the **Tools** menu, and click **Code Snippets Manager**.
105+
106+
4. Click the **Import** button.
107+
108+
5. Navigate to the folder containing TryCatch.snippet, click on the TryCatch.snippet file, and click the **Open** button. You should not have a TryCatch snippet in your **My Code Snippets** folder.
109+
110+
## See Also
111+
[Insert Surround-with Transact-SQL snippets](../../relational-databases/scripting/insert-surround-with-transact-sql-snippets.md)
112+
113+

docs/relational-databases/scripting/associate-file-extensions-to-a-code-editor.md renamed to docs/ssms/scripting/associate-file-extensions-to-a-code-editor.md

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
---
2-
title: "Associate File Extensions to a Code Editor | Microsoft Docs"
3-
ms.custom: ""
4-
ms.date: "03/01/2017"
5-
ms.prod: sql
6-
ms.prod_service: "sql-tools"
7-
ms.technology: scripting
8-
ms.reviewer: ""
9-
ms.topic: conceptual
10-
helpviewer_keywords:
11-
- "file extensions [SQL Server]"
12-
- "associating file extensions [SQL Server]"
13-
- "Query Editor [SQL Server Management Studio], associating file extensions"
14-
ms.assetid: 193630f4-93de-4950-8f36-68702531f925
15-
author: MightyPen
16-
ms.author: genemi
17-
manager: craigg
18-
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
19-
---
20-
# Associate File Extensions to a Code Editor
21-
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
22-
Associating file extensions to a specific code editor allows you to open a file with the appropriate [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] code editor when you double-click a file in Windows Explorer. The extensions commonly used by [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], such as .sql and .mdx, are associated during installation. New file extensions must also be associated to [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)] 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.
23-
24-
There are two steps in the process. First associate the extension with [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], and then associate the extension with a specific code editor.
25-
26-
### To associate a new file extension with SQL Server Management Studio
27-
28-
1. On the **Start** menu, point to **All Programs**, point to **Accessories**, and then click **Windows Explorer**.
29-
30-
2. In Windows Explorer, on the **Tools** menu, click **Folder Options**.
31-
32-
3. In the **Folder Options** dialog box, on the **File Types** tab, click **New**.
33-
34-
4. 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.
35-
36-
5. In the **Registered file** types box, click on your new extension, and then click **Change**.
37-
38-
6. In the **Open With** dialog box, click **SSMS – SQL Server Management Studio**, and then click **OK**.
39-
40-
7. Click **Close** to close the **Folder Options** dialog box, and then close Windows Explorer.
41-
42-
### To associate a new file extension with a code editor in SQL Server Management Studio
43-
44-
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], from the **Tools** menu, click **Options**.
45-
46-
2. In the **Options** dialog box, click **Text Editor**, and then click **File Extension**.
47-
48-
3. In the **Extension** box, type your new file extension.
49-
50-
4. In the **Editor** box, click the code editor that you wish to use to open this file type, click **Add**, and then click **OK**.
51-
52-
## See Also
53-
[Ssms Utility](../../tools/sql-server-management-studio/ssms-utility.md)
54-
55-
1+
---
2+
title: "Associate File Extensions to a Code Editor | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "03/01/2017"
5+
ms.prod: sql
6+
ms.prod_service: "sql-tools"
7+
ms.technology: scripting
8+
ms.reviewer: ""
9+
ms.topic: conceptual
10+
helpviewer_keywords:
11+
- "file extensions [SQL Server]"
12+
- "associating file extensions [SQL Server]"
13+
- "Query Editor [SQL Server Management Studio], associating file extensions"
14+
ms.assetid: 193630f4-93de-4950-8f36-68702531f925
15+
author: MightyPen
16+
ms.author: genemi
17+
manager: craigg
18+
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
19+
---
20+
# Associate File Extensions to a Code Editor
21+
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
22+
Associating file extensions to a specific code editor allows you to open a file with the appropriate [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] code editor when you double-click a file in Windows Explorer. The extensions commonly used by [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], such as .sql and .mdx, are associated during installation. New file extensions must also be associated to [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)] 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.
23+
24+
There are two steps in the process. First associate the extension with [!INCLUDE[ssManStudio](../../includes/ssmanstudio-md.md)], and then associate the extension with a specific code editor.
25+
26+
### To associate a new file extension with SQL Server Management Studio
27+
28+
1. On the **Start** menu, point to **All Programs**, point to **Accessories**, and then click **Windows Explorer**.
29+
30+
2. In Windows Explorer, on the **Tools** menu, click **Folder Options**.
31+
32+
3. In the **Folder Options** dialog box, on the **File Types** tab, click **New**.
33+
34+
4. 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.
35+
36+
5. In the **Registered file** types box, click on your new extension, and then click **Change**.
37+
38+
6. In the **Open With** dialog box, click **SSMS – SQL Server Management Studio**, and then click **OK**.
39+
40+
7. Click **Close** to close the **Folder Options** dialog box, and then close Windows Explorer.
41+
42+
### To associate a new file extension with a code editor in SQL Server Management Studio
43+
44+
1. In [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], from the **Tools** menu, click **Options**.
45+
46+
2. In the **Options** dialog box, click **Text Editor**, and then click **File Extension**.
47+
48+
3. In the **Extension** box, type your new file extension.
49+
50+
4. In the **Editor** box, click the code editor that you wish to use to open this file type, click **Add**, and then click **OK**.
51+
52+
## See Also
53+
[Ssms Utility](../../tools/sql-server-management-studio/ssms-utility.md)
54+
55+

0 commit comments

Comments
 (0)