From e13275506118b3ba6c16dc31bc37fb4e81128150 Mon Sep 17 00:00:00 2001 From: Ben Becker Date: Wed, 20 Nov 2019 09:32:32 -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 d3f608c..6557050 100644 --- a/ConvertFromExcelToSQLInsert.ps1 +++ b/ConvertFromExcelToSQLInsert.ps1 @@ -108,7 +108,7 @@ function ConvertFrom-ExcelToSQLInsert { 'NULL' } else { - "'" + (($record.$propertyName.ToString()) -replace "'","''") + "'" + "'" + (($record.$propertyName) -replace "'","''") + "'" } } $targetValues = ($values -join ", ")