# SQL Server API error selecting from system view information\_schema.schemata

**URL:** <https://community.dreamfactory.com/t/sql-server-api-error-selecting-from-system-view-information-schema-schemata/1519>\
**Category:** REST API\
**Created:** [September 24, 2015, 12:25am UTC](https://community.dreamfactory.com/t/sql-server-api-error-selecting-from-system-view-information-schema-schemata/1519 "2015-09-24T00:25:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuartheriot](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@stuartheriot](https://community.dreamfactory.com/u/stuartheriot)\
**Post date:** [September 24, 2015, 12:25am UTC](https://community.dreamfactory.com/t/sql-server-api-error-selecting-from-system-view-information-schema-schemata/1519/1 "2015-09-24T00:25:16Z")

</div>

I have created a service that connects to a sql server DB. I get the following error trying any of the API’s though

{  
“error”: [  
{  
“error\_detail”: {  
“SQLSTATE”: “42S02”,  
“driver\_name”: “mysql”,  
“driver\_error\_code”: 208,  
“driver\_error\_message”: “[Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name ‘information\_schema.schemata’.”  
},  
“message”: “CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Invalid object name ‘information\_schema.schemata’.”,  
“code”: 500  
}  
]  
}

I can run the query “select \* from INFORMATION\_SCHEMA.SCHEMATA” on the server to get details from the system view but cannot run “select \* from information\_schema.schemata”

Looking at the error log I don’t know why the driver\_name is “mysql” ?

Is there a way around this?

---

<div class="post-metadata">

**Author:** ![jeffreystables](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/jeffreystables/32/173_2.png) [@jeffreystables](https://community.dreamfactory.com/u/jeffreystables)\
**Post date:** [September 28, 2015, 1:59pm UTC](https://community.dreamfactory.com/t/sql-server-api-error-selecting-from-system-view-information-schema-schemata/1519/2 "2015-09-28T13:59:15Z")

</div>

We have seen this before when SQL Server is configured to be case-sensitive. This is not the average or expected config, so we had not allowed for it. The 1.x version of the API doesn’t expect that the actual thing that exists in the DB is INFORMATION\_SCHEMA.SCHEMATA and that it cannot be addressed in lowercase.

This is resolved in 2.0. If you would like to enforce uppercase in 1.x you will need to edit

```
<install path>/vendor/dreamfactory/yii/framework/db/schema/mssql/CMssqlSchema.php

```

There should be two instances, one near line 491 and one near 896, which you may edit to use uppercase.

---

<div class="post-metadata">

**Author:** ![stuartheriot](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@stuartheriot](https://community.dreamfactory.com/u/stuartheriot)\
**Post date:** [September 28, 2015, 11:26pm UTC](https://community.dreamfactory.com/t/sql-server-api-error-selecting-from-system-view-information-schema-schemata/1519/3 "2015-09-28T23:26:31Z")

</div>

I do need to work with case sensitive sql server. I have made the code changes recommended and works a treat.

Thanks.
