From 5617a960ec39e6f58990d4a58bd19dfc70c7f1e5 Mon Sep 17 00:00:00 2001 From: Ben Becker Date: Wed, 20 Nov 2019 08:13:11 -0500 Subject: [PATCH] fix for #512 & #525 There is an issue with the ConvertFromExcelToSQLInsert where a quote in the text will not be converted properly and will cause invalid insert statements to be created, this commit makes the correction to handle the scenario. --- ConvertFromExcelToSQLInsert.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ConvertFromExcelToSQLInsert.ps1 b/ConvertFromExcelToSQLInsert.ps1 index 7a3f00c..d3f608c 100644 --- a/ConvertFromExcelToSQLInsert.ps1 +++ b/ConvertFromExcelToSQLInsert.ps1 @@ -108,7 +108,7 @@ function ConvertFrom-ExcelToSQLInsert { 'NULL' } else { - "'" + $record.$propertyName + "'" + "'" + (($record.$propertyName.ToString()) -replace "'","''") + "'" } } $targetValues = ($values -join ", ")