You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm able to connect to sqlsrv, use Eloquent ORM to retrieve results, problem arise when I want to insert results. SQL server is using GUIDs and while I'm able to retrieve them, when I try to run MyModel::create($args) I get following error:
SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed when converting from a character string to uniqueidentifier. (SQL: insert into [dbo].[Test] ([Col1], [Col2], [Col3], [Col4], [Col5], [Col6]) values ('FB8DEE55-2B21-4C84-A999-190DAA0CA92D', 'test', '2BE7E405-446F-455A-A14D-6CCF5D2A48D8', '8BD51A9B-F1E5-4C2C-8D30-EE195D7DE06C', 'Test', AF7B1823-69F1-4E7A-B5D9-0395873666FC))
I have latest ODBC version installed. I can't find any instructions how to go about this error. I can run regular queries that do not use GUIDs.
SQL Server use native uniqueidentifier as column type.
This discussion was converted from issue #33414 on July 02, 2020 19:40.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Issue:
I'm able to connect to sqlsrv, use Eloquent ORM to retrieve results, problem arise when I want to insert results. SQL server is using GUIDs and while I'm able to retrieve them, when I try to run
MyModel::create($args)
I get following error:SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed when converting from a character string to uniqueidentifier. (SQL: insert into [dbo].[Test] ([Col1], [Col2], [Col3], [Col4], [Col5], [Col6]) values ('FB8DEE55-2B21-4C84-A999-190DAA0CA92D', 'test', '2BE7E405-446F-455A-A14D-6CCF5D2A48D8', '8BD51A9B-F1E5-4C2C-8D30-EE195D7DE06C', 'Test', AF7B1823-69F1-4E7A-B5D9-0395873666FC))
I have latest ODBC version installed. I can't find any instructions how to go about this error. I can run regular queries that do not use GUIDs.
SQL Server use native uniqueidentifier as column type.
Setup:
OS: Ubuntu 20.04 LTS
Laravel Framework 7.12.0
PHP 7.4.7
Installed
ODBC Driver 17 for SQL Server
also have mssql-server installed
Beta Was this translation helpful? Give feedback.
All reactions