-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Empty Strings added as DBNULL instead of " " #9
Comments
Thanks for the heads up Jake! Is this in Out-DataTable? I think that would make sense (or even a regex for whitespace). Can you think of any datasets where a space would be needed? Wonder if a switch 'WhitespaceIsNotNull' would make sense - convert whitespace to dbnull unless that is specified? Thanks! Warren |
Correct. I'm using it in conjuction with invoke-sqlbulkcopy. I'm sure the .NET class of IsNullOrEmpty would be appropriate in this case. I can't think of a reason for white space in a db. It would really cause And in powershell it would be tough to tell the difference between DBNULL Really appreciate all your work man. Your stuff has helped me more than you
|
I can confirm that I also had the empty string issue @jakedenyer was referring to and by adding this additional check: |
Warren -
Just noticed this when working with RVTools data from Excel and importing it to a database. Have some empty columns that are adding as empty strings in the DB instead of NULL.
Here is the line I modified to add a DBNULL value instead of an empty string.
Change to: elseif($Value -eq $null -or $Value -eq "")
The text was updated successfully, but these errors were encountered: