-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eloquent does not process transaction, rather it execute one statement at a time when using SQL Server #11723
Comments
Yeh, I don't think we support that. Ping @taylorotwell. |
@GrahamCampbell are you saying that Also, are you requesting me to send a message to @taylorotwell ? |
Yes.
No, me writing "Ping @taylorotwell." was me sending him a message. ;) |
Is there any way to solve the problem of not being able to insert ids in MSSQL through seeding yet? |
@marijnz0r, I had the same problem. As a workaround, I generated a T-SQL script and executed the whole thing using |
Here is an example
|
For anyone finding this thread via google etc - see this issue thread where it has been resolved: #27778 |
I am having problems with using SQL Server on Laravel 5.2.
Here are the problems that I found
I encounter the first problem when seeding tables where my identity column is preset.
What happens here is that the
DB::statement()
part is executed separately. Hopping to fix the problem using Eloquent, I wrapped my code in a transaction like soThe problem here is that the code in the
DB::statement()
block is not executed with in the transaction. In fact, it does not seems to be starting transaction at all.For my code to work I will have to do something nasty like this
This is causing me a big problem when using SQL Server.
Another issue with SQL Server is that when creating a schema the string length have a max value of 4000.
so running this migration will give me an error so I have to change my column length from 5000 to 4000. I don't know if this should automaticly be handled by the ORM or I should use a different column type.
The text was updated successfully, but these errors were encountered: