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
Use the .NET SQLBulkCopy class to write data to SQL Server tables.
5
+
6
+
.DESCRIPTION
7
+
Use the .NET SQLBulkCopy class to write data to SQL Server tables.
8
+
9
+
The data source is not limited to SQL Server; any data source can be used, as long as the data can be loaded to a DataTable instance or read with a IDataReader instance.
10
+
11
+
.PARAMETERServerInstance
12
+
A SQL instance to run against. For default instances, only specify the computer name: "MyComputer". For named instances, use the format "ComputerName\InstanceName".
13
+
14
+
.PARAMETERDatabase
15
+
A string specifying the name of a database.
16
+
17
+
.PARAMETERCredential
18
+
Specifies A PSCredential for SQL Server Authentication connection to an instance of the Database Engine. If -Credential is not specified, Invoke-Sqlcmd attempts a Windows Authentication connection using the Windows account running the PowerShell session.
19
+
SECURITY NOTE: If you use the -Debug switch, the connectionstring including plain text password will be sent to the debug stream.
20
+
21
+
.PARAMETERConnectionTimeout
22
+
Specifies the number of seconds when Invoke-Sqlcmd2 times out if it cannot successfully connect to an instance of the Database Engine. The timeout value must be an integer between 0 and 65534. If 0 is specified, connection attempts do not time out.
23
+
24
+
.PARAMETERForce
25
+
If specified, skip the confirm prompt
26
+
27
+
.PARAMETERBatchSize
28
+
The batch size for the bulk copy operation.
29
+
30
+
.PARAMETERNotifyAfter
31
+
The number of rows to fire the notification event after transferring. 0 means don't notify. Notifications hit the verbose stream (use -verbose to see them)
32
+
33
+
.PARAMETERColumnMappings
34
+
A hash table with the format Key = SourceColumn, Value = DestinationColumn
35
+
36
+
Example, converting SourceColumn FirstName to DestinationColumn surname, and converting SourceColumn LastName to DestinationColumn givenname
0 commit comments