Sunday, May 5, 2019

Import Excel to SQL Server Table

Import-Excel -Path C:\ETL\EXCEL-FILES\CONTACT.xlsx |
Write-SqlTableData -ServerInstance localhost -DatabaseName ETL -SchemaName import -TableName Contact -Force
 
 
-Force on Write-SqlTableData will create anything that doesn't exist; e.g. Databasename, SchemaName, TableName
 
 
Column types will be nvarchar(max)


No comments:

Post a Comment