Skip to content

Commit fe6f2ad

Browse files
committed
updated images for the Generate script content
1 parent f65bf95 commit fe6f2ad

20 files changed

Lines changed: 387 additions & 367 deletions

‎docs/ssms/scripting/generate-and-publish-scripts-wizard.md‎

Lines changed: 331 additions & 316 deletions
Large diffs are not rendered by default.
Lines changed: 56 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,73 @@
11
---
2-
title: "Generate Scripts (SQL Server Management Studio)"
3-
ms.custom: seo-lt-2019
4-
ms.date: "03/14/2017"
2+
title: Generate Scripts
53
ms.prod: sql
6-
ms.prod_service: "sql-tools"
4+
ms.prod_service: sql-tools
75
ms.technology: scripting
86
ms.reviewer: ""
97
ms.topic: conceptual
108
ms.assetid: 9711c617-3c68-4e5a-aea3-befc64d51524
119
author: markingmyname
1210
ms.author: maghan
13-
ms.reviewer: "mathoma"
11+
ms.reviewer: mathoma
12+
ms.custom: seo-lt-2019
13+
ms.date: 04/07/2020
1414
monikerRange: ">=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current"
1515
---
16+
1617
# Generate Scripts (SQL Server Management Studio)
18+
1719
[!INCLUDE[appliesto-ss-asdb-asdw-pdw-md](../../includes/appliesto-ss-asdb-asdw-pdw-md.md)]
18-
[!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] provides two mechanisms for generating [!INCLUDE[tsql](../../includes/tsql-md.md)] scripts. You can create scripts for multiple objects by using the **Generate and Publish Scripts Wizard**. You can also generate a script for individual objects or multiple objects by using the **Script as** menu in **Object Explorer**.
1920

20-
For a detailed Tutorial on scripting various objects using SQL Server Management Studio (SSMS), please see [Tutorial: Scripting in SSMS](https://docs.microsoft.com/sql/ssms/tutorials/scripting-ssms).
21+
[!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] provides two mechanisms for generating [!INCLUDE[tsql](../../includes/tsql-md.md)] scripts. You can create scripts for multiple objects by using the **Generate and Publish Scripts Wizard**. You can also generate a script for individual objects or multiple objects by using the **Script as** menu in **Object Explorer**.
2122

22-
23-
## Before You Begin
24-
Choose the mechanism that best meets your requirements.
25-
26-
### <a name="GenPubScriptWiz"></a> Generate and Publish Scripts Wizard
27-
Use the **Generate and Publish Scripts Wizard** to create a [!INCLUDE[tsql](../../includes/tsql-md.md)] script for many objects. The wizard generates a script of all the objects in a database, or a subset of the objects that you select. The wizard has many options for your scripts, such as whether to include permissions, collation, constraints, and so on. For instructions on using the wizard, see [Generate and Publish Scripts Wizard](../../relational-databases/scripting/generate-and-publish-scripts-wizard.md).
28-
29-
### <a name="OEScriptAsMenu"></a> Object Explorer Script As Menu
30-
You can use the **Object Explorer Script as** menu to script a single object, script multiple objects, or script multiple statements for a single object. You can choose one of several types of scripts; for example to create, alter, or drop the object. You can save the script in a Query Editor window, to a file, or to the Clipboard. The script is created in Unicode format.
31-
32-
## <a name="ScriptSingleObject"></a> To generate a script of a single object
33-
**To script a single object**
34-
35-
1. In Object Explorer, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
36-
37-
2. Expand **Databases**, and then expand the database containing the object to be scripted.
38-
39-
3. Expand the category of the object. For example, expand the **Tables** or **Views** node.
40-
41-
4. Right-click the object, point to **Script \<object type> as**, For example, point to **Script Table as**.
42-
43-
5. Point to the script type, such as **Create to** or **Alter to**.
44-
45-
6. Select the location to save the script, such as **New Query Editor Window** or **Clipboard**.
23+
For a detailed Tutorial on scripting various objects using SQL Server Management Studio (SSMS), see [Tutorial: Scripting in SSMS](https://docs.microsoft.com/sql/ssms/tutorials/scripting-ssms).
4624

47-
![Scripting table](media/generate-scripts-sql-server-management-studio/scripttable.png)
48-
49-
50-
You can use the **Object Explorer Details** pane to generate a script for multiple objects of the same category.
51-
52-
1. In Object Explorer, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
53-
54-
2. Expand **Databases**, and then expand the database containing the objects to be scripted.
55-
56-
3. Expand the category node of the types of object you want to script, such as the **Tables** node.
57-
58-
4. Open the **Object Explorer Details** pane by either selecting **F7**, or opening the **View** menu and selecting **Object Explorer Details**.
59-
60-
5. Left-click one of the objects you want to script.
61-
62-
6. Ctrl + left-click the second object you want to script.
63-
64-
7. Right-click one of the selected objects, and select **Script \<object type> as**.
25+
## Before You Begin
6526

66-
![Object Explorer](media/generate-scripts-sql-server-management-studio/objectexplorerdetails.png)
67-
27+
Choose the mechanism that best meets your requirements.
28+
29+
### <a name="GenPubScriptWiz"></a> Generate and Publish Scripts Wizard
30+
31+
Use the **Generate and Publish Scripts Wizard** to create a [!INCLUDE[tsql](../../includes/tsql-md.md)] script for many objects. The wizard generates a script of all the objects in a database, or a subset of the objects that you select. The wizard has many options for your scripts, such as whether to include permissions, collation, constraints, and so on. For instructions on using the wizard, see [Generate and Publish Scripts Wizard](../../relational-databases/scripting/generate-and-publish-scripts-wizard.md).
6832

33+
### <a name="OEScriptAsMenu"></a> Object Explorer Script As Menu
34+
35+
You can use the **Object Explorer Script as** menu to script a single object, script multiple objects, or script multiple statements for a single object. You can choose one of several types of scripts; for example to create, alter, or drop the object. You can save the script in a Query Editor window, to a file, or to the Clipboard. The script is created in Unicode format.
36+
37+
## <a name="ScriptSingleObject"></a> To generate a script of a single object
38+
39+
**To script a single object**
40+
41+
1. In Object Explorer, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
42+
43+
2. Expand **Databases**, and then expand the database containing the object to be scripted.
44+
45+
3. Expand the category of the object. For example, expand the **Tables** or **Views** node.
46+
47+
4. Right-click the object, point to **Script \<object type> as**, For example, point to **Script Table as**.
48+
49+
5. Point to the script type, such as **Create to** or **Alter to**.
50+
51+
6. Select the location to save the script, such as **New Query Editor Window** or **Clipboard**.
52+
53+
![Scripting table](media/generate-scripts-sql-server-management-studio/script-table.png)
54+
55+
You can use the **Object Explorer Details** pane to generate a script for multiple objects of the same category.
56+
57+
1. In Object Explorer, connect to an instance of the [!INCLUDE[ssDEnoversion](../../includes/ssdenoversion-md.md)] and then expand that instance.
58+
59+
2. Expand **Databases**, and then expand the database containing the objects to be scripted.
60+
61+
3. Expand the category node of the types of object you want to script, such as the **Tables** node.
62+
63+
4. Open the **Object Explorer Details** pane by either selecting **F7**, or opening the **View** menu and selecting **Object Explorer Details**.
64+
65+
![Object Explorer](media/generate-scripts-sql-server-management-studio/object-explorer-details-view-menu.png)
66+
67+
5. Left-click one of the objects you want to script.
68+
69+
6. Ctrl + left-click the second object you want to script.
70+
71+
7. Right-click one of the selected objects, and select **Script \<object type> as**.
72+
73+
![Object Explorer](media/generate-scripts-sql-server-management-studio/object-explorer-details.png)
63.5 KB
Loading

docs/ssms/scripting/media/generate-and-publish-scripts-wizard/advancedpublish.png renamed to docs/ssms/scripting/media/generate-and-publish-scripts-wizard/advanced-publish.png

File renamed without changes.
70.3 KB
Loading

docs/ssms/scripting/media/generate-and-publish-scripts-wizard/generatescripts.png renamed to docs/ssms/scripting/media/generate-and-publish-scripts-wizard/generate-scripts-old.png

File renamed without changes.
80.7 KB
Loading
70 KB
Loading
-1.27 KB
Loading
30 KB
Loading

0 commit comments

Comments
 (0)