You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 7, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: doc/documentation_page.md
+27-15Lines changed: 27 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,71 +10,83 @@ For information about installation, please see the LINK/install guide/LINK.
10
10
11
11
The examples in this guide use the Adventureworks sample database. You can download the sample [here](https://www.microsoft.com/en-us/download/details.aspx?id=49502).
12
12
13
-
## Dump database object schema
13
+
## Generate scripts
14
+
Use mssql-scripter to generate scripts for database schema and/or data by including specific objects, targeting server versions/editions, and piping the script to files.
15
+
16
+
### Dump database object schema
14
17
15
18
# generate DDL scripts for all objects in the Adventureworks database and save the script to a file
16
19
mssql-scripter -S localhost -d AdventureWorks -U sa
17
20
18
21
# alternatively, specify the schema only flag to generate DDL scripts for all objects in the Adventureworks database and save the script to a file
19
22
mssql-scripter -S localhost -d AdventureWorks -U sa -f ./adventureworks.sql
20
23
21
-
## Dump database object data
24
+
###Dump database object data
22
25
23
26
# generate DDL scripts for all objects in the Adventureworks database and save the script to stdout.
24
27
mssql-scripter -S localhost -d AdventureWorks -U sa --data-only
25
28
26
-
## Dump the database object schema and data
29
+
###Dump the database object schema and data
27
30
28
31
# script the database schema and data piped to a file.
29
32
mssql-scripter -S localhost -d AdventureWorks -U sa --schema-and-data > ./adventureworks.sql
30
33
31
34
# execute the generated above script with sqlcmd
32
35
sqlcmd -S mytestserver -U sa -i ./adventureworks.sql
33
36
34
-
## Include database objects
37
+
###Include database objects
35
38
36
39
# generate DDL scripts for objects that contain 'Employee' in their name to stdout
37
40
mssql-scripter -S localhost -d AdventureWorks -U sa --include-objects Employee
38
41
39
42
# generate DDL scripts for the dbo schema and pipe the output to a file
0 commit comments