# SQL Server function error

**URL:** <https://community.dremio.com/t/sql-server-function-error/3707>\
**Category:** Uncategorized\
**Created:** [July 18, 2019, 2:32pm UTC](https://community.dremio.com/t/sql-server-function-error/3707 "2019-07-18T14:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jharrington](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jharrington](https://community.dremio.com/u/jharrington)\
**Post date:** [July 18, 2019, 2:32pm UTC](https://community.dremio.com/t/sql-server-function-error/3707/1 "2019-07-18T14:32:51Z")

</div>

I have a SQL Server 2008 database set up as a Dremio source. When I try and run a SELECT that includes a CONCAT function call

`SELECT A, CONCAT('pre-', "B") as PreB FROM TABLE`

I get the following error:

`com.microsoft.sqlserver.jdbc.SQLServerException: 'CONCAT' is not a recognized built-in function name.`

CONCAT was not introduced to SQL server until 2012 but I had assumed Dremio would fallback on its own SQL engine?

2008 does allow string concatenation using `+` but if I try that i get a calcite error:

`org.apache.calcite.sql.validate.SqlValidatorException: Cannot apply '+' to arguments of type '<VARCHAR(4)>....'`

Is there anyway to work around this?

---

<div class="post-metadata">

**Author:** ![jharrington](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jharrington](https://community.dremio.com/u/jharrington)\
**Post date:** [July 18, 2019, 2:39pm UTC](https://community.dremio.com/t/sql-server-function-error/3707/2 "2019-07-18T14:39:09Z")

</div>

I have just found a workaround, for SQL server 2008 you can use

`SELECT A, {fn CONCAT('pre-', B)} as PreB FROM TABLE`

This calls the ODBC function in SQL Server and calcite parses it.

However it still feels like a leaky abstraction to me and I would like to know what the **correct** solution would be.

---

<div class="post-metadata">

**Author:** ![doron](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/doron/32/294_2.png) [@doron](https://community.dremio.com/u/doron)\
**Post date:** [July 19, 2019, 5:49pm UTC](https://community.dremio.com/t/sql-server-function-error/3707/3 "2019-07-19T17:49:41Z")

</div>

@jharrington

Dremio only supports SQL Server 2012 and above, which we are missing in our documentation (opened a ticket to fix that). So for your case there probably is no better way.

---

<div class="post-metadata">

**Author:** ![jharrington](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jharrington](https://community.dremio.com/u/jharrington)\
**Post date:** [July 22, 2019, 9:24am UTC](https://community.dremio.com/t/sql-server-function-error/3707/4 "2019-07-22T09:24:37Z")

</div>

Ok, disappointed to hear that. Thanks for the response.
