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

MSSQL - Could not find stored procedure 'object Object' #1669

KromDaniel opened this issue Sep 15, 2016 · 5 comments

MSSQL - Could not find stored procedure 'object Object' #1669

KromDaniel opened this issue Sep 15, 2016 · 5 comments


Copy link

@KromDaniel KromDaniel commented Sep 15, 2016

NodeJS v6.4.0
knex 0.12.0
MSSQL (NPM) 3.3.0
Running the next code:

 .from("dbo.brData as brd")
 .fullOuterJoin("dbo.phs as phs","brd.ph_id","")
 .fullOuterJoin("dbo.pat as pat","pat.path","phs.path")
      .orWhere("brd.t_id ","someId");

Always returns the error:

Could not find stored procedure 'object Object'.

If I'm doing queryBuilder.toString() it returns good and valid query but queryBuilder.raw(query.toString) returns same error


Copy link

@cdmcnamara cdmcnamara commented Sep 15, 2016

I was encountering this issue too, and it looks like the culprit is this change: 0b25f6b#diff-94c7d1519ac82e543cc9008e996e4c63L104.

When I revert those two lines on my test file, it appears to work again.

Copy link

@cdmcnamara cdmcnamara commented Sep 15, 2016

I'd like to make a pull request to fix it but I'm not entirely sure what the point of this block is as sql is originally a string, but then it looks like it's trying to make it an object that contains a sql field and the fields from obj.options using assign.

@tgriesser, could you shed some light?

Copy link

@hitgeek hitgeek commented Sep 16, 2016

having same issue.
simple select * query returns "Could not find stored procedure 'object Object'"in 0.12, but works in 0.11.

MSSQL Trace shows the query exec sp_executesql @statement=N'[object Object]'

@tgriesser tgriesser closed this in 29f5070 Sep 16, 2016
Copy link

@tgriesser tgriesser commented Sep 16, 2016

I think the commit I just added should fix it, will cut a release shortly

Copy link

@KromDaniel KromDaniel commented Sep 16, 2016

Thanks for the real quick solution!

tgriesser added a commit that referenced this issue Sep 16, 2016
* master:
  release 0.12.1
  Add DEBUG=knex:bindings for #1557
  Fix #1669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants