mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-15 15:53:32 +00:00
tweaked
This commit is contained in:
@@ -1,8 +1,5 @@
|
|||||||
Clear-Host
|
|
||||||
|
|
||||||
Import-Module .\ImportExcel.psd1 -Force
|
ConvertFrom-ExcelToSQLInsert People .\testSQLGen.xlsx
|
||||||
|
|
||||||
#ConvertFrom-ExcelToSQLInsert People .\testSQLGen.xlsx
|
|
||||||
|
|
||||||
ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
||||||
param($propertyNames, $record)
|
param($propertyNames, $record)
|
||||||
@@ -13,16 +10,4 @@ ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
|||||||
}
|
}
|
||||||
$reportRecord +=""
|
$reportRecord +=""
|
||||||
$reportRecord -join "`r`n"
|
$reportRecord -join "`r`n"
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
|
|
||||||
ConvertFrom-ExcelData .\testSQLGen.xlsx {
|
|
||||||
param($propertyNames, $record)
|
|
||||||
|
|
||||||
$ColumnNames = "'" + ($PropertyNames -join "', '") + "'"
|
|
||||||
$values = foreach ($propertyName in $PropertyNames) { $record.$propertyName }
|
|
||||||
$targetValues = "'" + ($values -join "', '") + "'"
|
|
||||||
|
|
||||||
"INSERT INTO People ({0}) Values({1});" -f $ColumnNames, $targetValues
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user