Hi there I need some help with Symfony 3 and a MS SQL Server:
I am using Symfony 3 and want to connect to a MS SQL Server, I've done some research and found out that it is not supported by default but there are some Bundles available to use.
After trying some of them I found one Bundle which partially worked for me (realestateconz/mssql-bundle) but I get an error Message everytime I try to query the DB (I formatted it to be more readable):
Uncaught PHP Exception Doctrine\DBAL\DBALException: An exception occurred while executing
t0.id AS id_1,
t0.username AS username_2
FROM user t0
WHERE t0.username = ?' with params ["testusername"]:
SQLSTATE[HY000]: General error: 156 General SQL Server error:
Check messages from the SQL Server  (severity 15) [(null)]
$user = $em->getRepository('AppBundle:User')->findBy(array('username' => $username));
database_name: database #without schema
host = myserveradress
port = 1433
tds version = 8.0
client charset = UTF-8
text size = 20971520
I found the problem myself, you need to give Doctrine the exact Table name for your Entities in the Syntax the SQL-Server uses.
For the annotation Format Symfony uses it would look like this:
/** Annotation for your Classfile * ExampleClass * * @ORM\Table(name="[ExampleClass]") <-- Square Brackets for MSSQL * @ORM\Entity */
After Changing the Tablename to MSSQL Format everything worked as expected.