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

Issue using Named parameters with SQL Server #457

Closed
sunit-joshi opened this issue Oct 1, 2018 · 1 comment
Closed

Issue using Named parameters with SQL Server #457

sunit-joshi opened this issue Oct 1, 2018 · 1 comment

Comments

@sunit-joshi
Copy link

I've a sql string like:

INSERT INTO ADAccount (samaccount, userprincipal, employeetype, extattr9, extattr10, manager, pwdlastsetutc, pwdexpiresutc) VALUES (@samaccount, @userprincipal, @employeetype, @extattr9, @extattr10, @manager,@pwdlastsetutc, @pwdexpiresutc)

When I try this (acNew is a Struct), I get an error:
ntstm, err := Db.PrepareNamedContext(ctx, sqlString)
_, err = ntstm.Exec(acNew)

mssql: Must declare the scalar variable "@samAccount".

Any thoughts?
SJ

@jmoiron
Copy link
Owner

jmoiron commented Oct 16, 2018

Should be fixed with #406

@jmoiron jmoiron closed this as completed Oct 16, 2018
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

2 participants