Skip to content
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

Inserting multiple rows from an object array. UTF-8? #50

Open
Walraz opened this issue May 1, 2016 · 0 comments
Open

Inserting multiple rows from an object array. UTF-8? #50

Walraz opened this issue May 1, 2016 · 0 comments

Comments

@Walraz
Copy link

Walraz commented May 1, 2016

Getting:
RequestError: The error description is 'An invalid character was found in text content.'
When trying to INSERT 'åäö' chars into my table using multiple rows from an object array asTable.

This one works...
query: "INSERT INTO Table (Char) VALUES (@char)", params: { char: { val: 'ÅÄÖ', type: sql.NVARCHAR } }

This one doesn't work ...
query: "INSERT INTO Table (Id, Char) " + "SELECT @parentId, value FROM @chars", params: { parentId: { val: 123, type: sql.INT }, chars: { val: [ 'å', 'ä', 'ö'], type: sql.NVARCHAR, asTable: true }

And this doesn't work...
query: "INSERT INTO Children (Id, Char) " + "SELECT @parentId, char FROM @chars", params: { parentId: { val: 123, type: sql.INT }, chars: { val: [ { char: 'å' }, { char: 'ä' }, { char: 'ö' } asTable: { char: sql.NVARCHAR, } } }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant