Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Zero length varchar params don't work unless a length greater than zero #109

Closed
wants to merge 1 commit into from

1 participant

Mark Gardner
Mark Gardner

I ran into an issue where a sql statement could be generated with a parameter type of varchar(0) which sql server didn't seem to allow.

Changing the minimum value to 1 seemed to fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 6, 2013
  1. Mark Gardner
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/data-type.coffee
4 src/data-type.coffee
View
@@ -295,7 +295,7 @@ TYPE =
length = @.maximumLength
if length <= @maximumLength
- "varchar(#{length})"
+ "varchar(#{Math.max(length,1)})"
else
"varchar(max)"
writeParameterData: (buffer, parameter) ->
@@ -355,7 +355,7 @@ TYPE =
length = @maximumLength
if length <= @maximumLength
- "nvarchar(#{length})"
+ "nvarchar(#{Math.max(length,1)})"
else
"nvarchar(max)"
writeParameterData: (buffer, parameter) ->
Something went wrong with that request. Please try again.