5
5
. Description
6
6
Copies schema, structure (tables, views, etc.), to an empty SQL Server databaase. Also supports copying data via bcp.
7
7
8
- . Parameter ServerName - Database to copy from
9
- . Parameter DestinationServer - Database to copy to
10
- . Parameter SourceUser - Database User for the source database
11
- . Parameter SourcePassword - Password for the source database
12
- . Parameter DestinationUser - Database User for the destination database
13
- . Parameter DestinationPassword - Password for the destination database
14
- . Parameter SourceDatabase - name of the databse to copy too
15
- . Parameter DestinationDB - name of the destination database
16
- . Parameter CopyData = - flag to trigger bulk copy of data to destination database
17
- . Parameter fileName - Path to the Schema.sql file included in this repo ".\ExtractDB\Schema.sql"
18
- . Parameter tempPath - A temp directory on a drive with enough free space to save the bcp files during the export and import operations ".\BCP\"
19
- . Parameter logPath - directory to write error logs too ".\log\"
8
+ . Parameter ServerName
9
+ Database to copy from
10
+ . Parameter DestinationServer
11
+ Database to copy to
12
+ . Parameter SourceUser
13
+ Database User for the source database
14
+ . Parameter SourcePassword -
15
+ Password for the source database
16
+ . Parameter DestinationUser
17
+ Database User for the destination database
18
+ . Parameter DestinationPassword
19
+ Password for the destination database
20
+ . Parameter SourceDatabase
21
+ Name of the databse to copy too
22
+ . Parameter DestinationDB
23
+ Name of the destination database
24
+ . Parameter CopyData
25
+ Flag to trigger bulk copy of data to destination database
26
+ . Parameter fileName
27
+ Path to the Schema.sql file included in this repo ".\ExtractDB\Schema.sql"
28
+ . Parameter tempPath
29
+ A temp directory on a drive with enough free space to save the bcp files during the export and import operations ".\BCP\"
30
+ . Parameter logPath
31
+ Directory to write error logs too ".\log\"
20
32
21
33
22
34
#>
@@ -32,7 +44,7 @@ function copy-database{
32
44
$SourceDatabase ,
33
45
$DestinationDB ,
34
46
$CopyData ,
35
- $fileName ,
47
+ $fileName = " ..\ExtractDB\Schema.sql " ,
36
48
$tempPath ,
37
49
$logPath
38
50
)
0 commit comments