Incorrect syntax near the keyword 'TO'

### System Info

langchain version 0.0.198, 
windows, 
SQL Server 16.0.4025.1 windows docker container (linux)

In the output I get the message:
Incorrect syntax near the keyword 'TO'

and program not ends correctly

### Who can help?

_No response_

### Information

- [ ] The official example notebooks/scripts
- [X] My own modified scripts

### Related Components

- [X] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [ ] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

**my python program:**

server = 'localhost,1435'
database = 'MyDB'
username = 'me'
pwd = '****'
driver= 'ODBC Driver 17 for SQL Server'

def db_instance():
    #Creating SQLAlchemy connection sting
    connectionString = 'DRIVER='+driver+';SERVER=tcp:'+server+';PORT=1433;DATABASE='+database+';UID='+username+';PWD='+ pwd+';Encrypt=no;TrustServerCertificate=no;Connection Timeout=30;'
    print(connectionString)
    params = urllib.parse.quote_plus(connectionString)
    conn_str = 'mssql+pyodbc:///?odbc_connect={}'.format(params)
    db_instance = SQLDatabase.from_uri(conn_str,schema='ALG')
    return db_instance

db = db_instance()

print(db.table_info)

# Setting API Key and API endpoint for OpenAI
os.environ['OPENAI_API_TOKEN'] = '....'

llm = OpenAI(model_name='text-davinci-003')

# LangChain Agent
toolkit = SQLDatabaseToolkit(db=db, llm = llm)

agent_executor = create_sql_agent(
    llm= llm,
    toolkit=toolkit,
    verbose=True,
    top_k = 5
)

# Test
agent_executor.run("'how many Messages are in the DB'")

### Expected behavior

**Output from terminal:** 
SELECT Message_0_0.*, Message_0_100001.*, Message_0_100002.*, Message_0_100003.*, Message_0_100004.*, Message_0_100000.*, Message_0_99999.*
FROM Message_0_0
INNER JOIN Message_0_100001 ON Message_0_0.id = Message_0_100001.id
INNER JOIN Message_0_100002 ON Message_0_0.id = Message_0_100002.id
INNER JOIN Message_0_100003 ON Message_0_0.id = Message_0_100003.id
INNER JOIN Message_0_100004 ON Message_0_0.id = Message_0_100004.id
INNER JOIN Message_0_100000 ON Message_0_0.id = Message_0_100000.id
INNER JOIN Message_0_99999 ON Message_0_0.id = Message_0_99999.id
Thought: The query looks correct, I can now execute it.
Action: query_sql_db
Action Input: SELECT Message_0_0.*, Message_0_100001.*, Message_0_100002.*, Message_0_100003.*, Message_0_100004.*, Message_0_100000.*, Message_0_99999.*
FROM Message_0_0
INNER JOIN Message_0_100001 ON Message_0_0.id = Message_0_100001.id
INNER JOIN Message_0_100002 ON Message_0_0.id = Message_0_100002.id
INNER JOIN Message_0_100003 ON Message_0_0.id = Message_0_100003.id
INNER JOIN Message_0_100004 ON Message_0_0.id = Message_0_100004.id
INNER JOIN Message_0_100000 ON Message_0_0.id = Message_0_100000.id
INNER JOIN Message_0_99999 ON Message_0_0.id = Message_0_99999.id
Obs
Observation: Error: (pyodbc.ProgrammingError) ('42000', "[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'TO'. (156) (SQLExecDirectW)")
[SQL: SET search_path TO ALG]
(Background on this error at: https://sqlalche.me/e/20/f405)
Thought: I should double check my query again with the query checker.
Action: query_checker_sql_db
Action Input: SELECT Message_0_0.*, Message_0_100001.*, Message_0_100002.*, Message_0_100003.*, Message_0_100004.*, Message_0_100000.*, Message_0_99999.*
FROM Message_0_0
INNER JOIN Message_0_100001 ON Message_0_0.id = Message_0_100001.id
INNER JOIN Message_0_100002 ON Message_0_0.id = Message_0_100002.id
INNER JOIN Message_0_100003 ON Message_0_0.id = Message_0_100003.id
INNER JOIN Message_0_100004 ON Message_0_0.id = Message_0_100004.id
INNER JOIN Message_0_100000 ON Message_0_0.id = Message_0_100000.id
INNER JOIN Message_0_99999 ON Message_0_0.id = Message_0_99

The message query looks correct it should get the correct count.
**SQL server trace contains also the query:**
SET search_path TO ALG

I found that string in the github repo under /sql_database.py
line 347
```
        with self._engine.begin() as connection:
            if self._schema is not None:
                if self.dialect == "snowflake":
                    connection.exec_driver_sql(
                        f"ALTER SESSION SET search_path='{self._schema}'"
                    )
                elif self.dialect == "bigquery":
                    connection.exec_driver_sql(f"SET @@dataset_id='{self._schema}'")
                else:
                    connection.exec_driver_sql(f"SET search_path TO {self._schema}")
```