ITGURU Posted October 29, 2019 Posted October 29, 2019 I currently run a SIMS report manually which opens in excel, i then save this as an XLS, and import into SQL server manually by choosing the excel source file. I want to automate this. I've got it working, however when I run command reporter and it creates the CSV file, it puts quotes ( " ) around each word. When i then create a sql script to import the file, each field value has the quotes around each word. How do i do the export but not put the quotes around each entry Thanks.
forkies Posted October 29, 2019 Posted October 29, 2019 I don’t think you can do this from command reporter perspective, it is quite limited. I would invoke this using a power shell script, then take the export and remove the ‘’ from the exported file using power shell. You can also quality check before you import into sql. As an alternative does it do it if the export is txt file instead?
MicrodigitUK Posted October 30, 2019 Posted October 30, 2019 Export to CSV then using VBA convert the CSV to Excel and then it should import. Alternatively can’t you just use command line reporter to export to CSV and import a CSV directly to SQL?
ITGURU Posted October 30, 2019 Author Posted October 30, 2019 Export to CSV then using VBA convert the CSV to Excel and then it should import. Alternatively can’t you just use command line reporter to export to CSV and import a CSV directly to SQL? If you can help with that then may?! :-)
tdk1069 Posted October 30, 2019 Posted October 30, 2019 I have a scheduled Powershell script that runs several (28, wow never counted them before) reports, then uses Start-Process and MySQL.exe to read them into my own MySQL Database, which I use to process. I use 'LOAD DATA LOCAL INFILE ' to pull it in, but I also ran into the quoting issue but found in MySQL you can use 'OPTIONALLY ENCLOSED BY `"`' which solved my issue (I'm not sure from your post if you are using MSSQL or MySQL.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now