# Microsoft SQL Connector - Adding empty spaces in columns from imported double quoted CSV file

**URL:** <https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696>\
**Category:** Questions\
**Tags:** microsoft-sql\
**Created:** [May 31, 2023, 2:55pm UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696 "2023-05-31T14:55:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmorneau](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cmorneau](https://community.n8n.io/u/cmorneau)\
**Post date:** [May 31, 2023, 2:55pm UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/1 "2023-05-31T14:55:33Z")

</div>

I have a question about the Microsoft SQL connector, Insert function.

When using a CSV file file as a source to import into SQL, the values imported in the database have empty spaces.

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/1/4/14c7e135c19758d623b29b63fd2fefb06fde2159.png)

If we look at the source data, no empty spaces are present in the source JSON from the **Convert to Spreadsheet** step:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/d/2/d257dd6c7422d6a214bcd4a09ae34e70f24396c1.png)

I have noted this issue seems to only happen when values, in the source file, are in double quotes. Here is the sample data:

“Template Name”,“Org Unit Code”,“Hiring Leader User Sys ID”,“Hiring Leader Name”,“Job Req ID”,“Job Title”,“Work Location City”,“recruitingV2#RCM\_JOB\_REQ#STATE\_PROVINCE”,“New / Replacement”,“Reason / Justification”,“Schedule”,“Job Status”,“Company”,“TA Consultant User Sys ID”,“TA Consultant Name”,“Employee ID”,“Candidate ID”,“Candidate Name”,“HireType”,“Source Details”,“Start Year”,“Start Month”,“Start Date”,“Hired On”,“New Hire Cost Centre”,“Is this a Cutover Requisition”,“Time to Hire”,“SAP Job Title”,“Work Location (CLLI)”,“RSU”,“Candidate Work Location City”  
“Retail Requisition”,“12345678”,“C12345678”,“Test Test”,“12345678”,“Store Test”,“Test Town”,“12345678”,"New ",“Test Comments bla bla bla bla…”,“Regular”,“Full Time”,“C12345678”,“Test Test2”,“12345678”,“Test Test2”,“Internal Hires”,“Recruiter Sourced”,“2022”,“1”,“1/1/2022”,“1/13/2023”,“12345678”,“120.62”,“Store Test”,“TM, Test Mall(HGTHHGFT)”,123456,“Test Town”

I do need the double quotes in my file as certain records may be multiple lines.

Have you encountered this issue before and have a possible cause and fix ?

Thanks,

Christian

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 1, 2023, 7:47am UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/2 "2023-06-01T07:47:15Z")

</div>

Hey @cmorneau,

That is odd, I would expect us to insert the data as you see it in n8n 🤔 If you query the data in SQL does it display correctly or does it only have the spaces when you export it?

---

<div class="post-metadata">

**Author:** ![cmorneau](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cmorneau](https://community.n8n.io/u/cmorneau)\
**Post date:** [June 1, 2023, 11:08am UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/3 "2023-06-01T11:08:44Z")

</div>

Hello Jon,

The spaces are present when I export data, may it be from Microsoft SQL Server or n8n.

Working correctly aka no spaces with a file without double quotes.

Thanks,

Christian

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 1, 2023, 1:30pm UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/4 "2023-06-01T13:30:01Z")

</div>

Hey @cmorneau,

That is interesting, I guess if the data is correct when doing a select in SSMS or similar tools then it might be something funky with the export.

---

<div class="post-metadata">

**Author:** ![cmorneau](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cmorneau](https://community.n8n.io/u/cmorneau)\
**Post date:** [June 1, 2023, 2:49pm UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/5 "2023-06-01T14:49:49Z")

</div>

Hello @Jon,

Feel free to try to recreate it with my provided data. It seems to be in the correct format and encoding, just having double quotes. It’s only in this scenario of double quotes in the source file that it happens.

Thanks,

Christian

---

<div class="post-metadata">

**Author:** ![cmorneau](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@cmorneau](https://community.n8n.io/u/cmorneau)\
**Post date:** [June 6, 2023, 1:40am UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/6 "2023-06-06T01:40:31Z")

</div>

Cause found, fix applied !!

I was using nchar in my columns instead of nvarchar. I just dropped and recreated my table with all variables in nvarchar, no empty spaces anymore.

Closing issue.

Christian

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 6, 2023, 8:19am UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/7 "2023-06-06T08:19:10Z")

</div>

That is a nice find.

---

<div class="post-metadata">

**Author:** ![Jon](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/jon/32/40174_2.png) [@Jon](https://community.n8n.io/u/Jon)\
**Post date:** [June 6, 2023, 8:19am UTC](https://community.n8n.io/t/microsoft-sql-connector-adding-empty-spaces-in-columns-from-imported-double-quoted-csv-file/26696/8 "2023-06-06T08:19:14Z")

</div>

Closed on June 6, 2023, 8:19am UTC


