# smallmoney data type in sql server

**URL:** <https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118>\
**Category:** General Discussion\
**Created:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118 "2009-06-25T19:14:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![rynam0](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rynam0](https://forum.liquibase.org/u/rynam0)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/1 "2009-06-25T19:14:00Z")

</div>

Hello all,  
&nbsp; &nbsp; I have an initial changelog generated (using generateChangeLog command) from our production sqlserver database and I am trying to run this against a new local sqlserver instance using the update command.&nbsp; Here’s the problem:&nbsp; The production db contains a table that has a column with the smallmoney datatype.&nbsp; The generateChangeLog command did not see this as an invalid datatype but the update command is complaining that it IS invalid.&nbsp; Is this is known issue or is this something I should file a JIRA for?&nbsp; Any help would be greatly appreciated!

BTW: I’m sorry I missed out on the chat this afternoon.&nbsp; Thanks for posting the transcript!

-Ryan

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/2 "2009-06-25T19:14:00Z")

</div>

Are you getting a stacktrace error you could post?&nbsp; If not, run liquibase with a logLevel=FINEST.&nbsp; It is not a known issue, if you could file a jira issue, that would be great.

Nathan

---

<div class="post-metadata">

**Author:** ![rynam0](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rynam0](https://forum.liquibase.org/u/rynam0)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/3 "2009-06-25T19:14:00Z")

</div>

Sure thing, here’s the stack trace from running update on my initial changelog.&nbsp; I’ll post this to JIRA in a moment.

Migration Failed: Error executing SQL CREATE TABLE [dbo].[yit] ([id] VARCHAR(50), [famly] INT, [child] smallint, [startdate] DATETIME,  
[enddate] DATETIME, [district\_code] CHAR(1), [caseworker\_id] VARCHAR(50), [client\_contribution] SMALLMONEY(10,4), [contribution\_start]  
DATETIME, [daily\_rate] smallmoney(10,4), [payeeId] INT, [agreements] TEXT, [created] DATETIME, [createdby] VARCHAR(50), [modified] DATE  
TIME, [modifiedby] VARCHAR(50), [denied] DATETIME, [deniedby] VARCHAR(50), [approved] DATET  
IME, [approvedby] VARCHAR(50), [terminated] DATETIME, [terminatedby] VARCHAR(50), [type] smallint).&nbsp; For more  
information, use the --logLevel flag)  
Jun 25, 2009 3:59:36 PM liquibase.commandline.Main main  
SEVERE: Error executing SQL CREATE TABLE [dbo].[yit] ([id] VARCHAR(50), [famly] INT, [child] smallint, [startdate] DATETIME, [enddate]  
DATETIME, [district\_code] CHAR(1), [caseworker\_id] VARCHAR(50), [client\_contribution] SMALLMONEY(10,4), [contribution\_start] DATETIME,  
[daily\_rate] smallmoney(10,4), [payeeId] INT, [agreements] TEXT, [created] DATETIME, [createdby] VARCHAR(50), [modified] DATETIME, [mod  
ifiedby] VARCHAR(50), [denied] DATETIME, [deniedby] VARCHAR(50), [approved] DATETIME, [appr  
ovedby] VARCHAR(50), [terminated] DATETIME, [terminatedby] VARCHAR(50), [type] smallint)  
liquibase.exception.MigrationFailedException: Migration failed for change set CHANGELOGS/SRSDSS.root.changelog.xml::1245943587171-146::  
ryan.connolly (generated):  
&nbsp; &nbsp; Reason: liquibase.exception.JDBCException: Error executing SQL CREATE TABLE [dbo].[yit] ([id] VARCHAR(50), [famly] INT, [child] sm  
allint, [startdate] DATETIME, [enddate] DATETIME, [district\_code] CHAR(1), [caseworker\_id] VARCHAR(50), [client\_contribution] SMALLMONE  
Y(10,4), [contribution\_start] DATETIME, [daily\_rate] smallmoney(10,4), [payeeId] INT, [agreements] TEXT, [created] DATETIME, [createdby  
] VARCHAR(50), [modified] DATETIME, [modifiedby] VARCHAR(50), [denied] DATETIME, [deniedby] VARCHAR(50), [approved] DATETIME, [approvedby] VARCHAR(50), [terminated] DATETIME, [terminatedby] VARCHAR(50)  
, [type] smallint):  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Caused By: Error executing SQL CREATE TABLE [dbo].[yit] ([id] VARCHAR(50), [famly] INT, [child] smallint, [startdate] DATETIM  
E, [enddate] DATETIME, [district\_code] CHAR(1), [caseworker\_id] VARCHAR(50), [client\_contribution] SMALLMONEY(10,4), [contribution\_star  
t] DATETIME, [daily\_rate] smallmoney(10,4), [payeeId] INT, [agreements] TEXT, [created] DATETIME, [createdby] VARCHAR(50), [modified] D  
ATETIME, [modifiedby] VARCHAR(50), [denied] DATETIME, [deniedby] VARCHAR(50), [approved] DA  
TETIME, [approvedby] VARCHAR(50), [terminated] DATETIME, [terminatedby] VARCHAR(50), [type] smallint):  
&nbsp; &nbsp; &nbsp; &nbsp; Caused By: Parameter or variable ‘client\_contribution’ has an invalid data type.  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.ChangeSet.execute(ChangeSet.java:260)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.parser.visitor.UpdateVisitor.visit(UpdateVisitor.java:26)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.parser.ChangeLogIterator.run(ChangeLogIterator.java:41)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.Liquibase.update(Liquibase.java:112)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.commandline.Main.doMigration(Main.java:650)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.commandline.Main.main(Main.java:97)  
Caused by: liquibase.exception.JDBCException: Error executing SQL CREATE TABLE [dbo].[yit] ([id] VARCHAR(50), [famly] INT, [child] smal  
lint, [startdate] DATETIME, [enddate] DATETIME, [district\_code] CHAR(1), [caseworker\_id] VARCHAR(50), [client\_contribution] SMALLMONEY(  
10,4), [contribution\_start] DATETIME, [daily\_rate] smallmoney(10,4), [payeeId] INT, [agreements] TEXT, [created] DATETIME, [createdby]  
VARCHAR(50), [modified] DATETIME, [modifiedby] VARCHAR(50), [isdenied] smallint, [denied] DATETIME, [deniedby] VARCHAR(50), [isapproved  
] smallint, [approved] DATETIME, [approvedby] VARCHAR(50), [isterminated] smallint, [terminated] DATETIME, [terminatedby] VARCHAR(50),  
[type] smallint)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:55)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:86)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.change.AbstractChange.execute(AbstractChange.java:247)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.change.AbstractChange.executeStatements(AbstractChange.java:93)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.ChangeSet.execute(ChangeSet.java:236)  
&nbsp; &nbsp; &nbsp; &nbsp; … 5 more  
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Parameter or variable ‘client\_contribution’ has an invalid data type.  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at com.microsoft.sqlserver.jdbc.SQLServerStatement.execute(Unknown Source)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.database.template.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:78)  
&nbsp; &nbsp; &nbsp; &nbsp; at liquibase.database.template.JdbcTemplate.execute(JdbcTemplate.java:48)  
&nbsp; &nbsp; &nbsp; &nbsp; … 9 more

---

<div class="post-metadata">

**Author:** ![rynam0](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rynam0](https://forum.liquibase.org/u/rynam0)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/4 "2009-06-25T19:14:00Z")

</div>

Nathan:  
&nbsp; &nbsp; Looking into this a little closer, it appears that Liquibase is adding params to the smallmoney datatype wherein there should not be any:&nbsp; lb is generating the column definition as smallmoney(10,4) NULL&nbsp; when SQLServer expects the definition to be smallmoney NULL.&nbsp; I hope this helps.&nbsp; Is there anything I can do to help track this down?

Thanks!  
-Ryan

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/5 "2009-06-25T19:14:00Z")

</div>

That is all I needed, I put a snapshot of 1.9 at [http://www.liquibase.org/liquibase-SNAPSHOT.jar.&nbsp;](http://www.liquibase.org/liquibase-SNAPSHOT.jar.%C2%A0) Could you let me know if that fixes the problem?&nbsp; It had been handling “MONEY” but not “SMALLMONEY”

Nathan

---

<div class="post-metadata">

**Author:** ![rynam0](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rynam0](https://forum.liquibase.org/u/rynam0)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/6 "2009-06-25T19:14:00Z")

</div>

Hey, Nathan… that SNAPSHOT isn’t packaged (just compiled) like a distribution so I’m not quite sure how to run this… I’ve been simply updating my LIQUIBASE\_HOME environment variable to toggle between versions.&nbsp; I’d be more than happy to give this a go if you could post one w/ the bat file, jar, etc.

Thanks!

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/7 "2009-06-25T19:14:00Z")

</div>

I uploaded [www.liquibase.org/liquibase-1.9.4.zip](http://www.liquibase.org/liquibase-1.9.4.zip), give it a try.

Nathan

---

<div class="post-metadata">

**Author:** ![rynam0](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rynam0](https://forum.liquibase.org/u/rynam0)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/8 "2009-06-25T19:14:00Z")

</div>

Works like a charm, Nathan.&nbsp; Thanks alot.&nbsp; Is this going to be in a 1.9.5 release?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [June 25, 2009, 7:14pm UTC](https://forum.liquibase.org/t/smallmoney-data-type-in-sql-server/118/9 "2009-06-25T19:14:00Z")

</div>

Good to hear.&nbsp; Thanks for checking it out.&nbsp;

It will be in the 1.9.5 release (not date scheduled yet) as well as the 2.0 release (late summer)
