[GH-ISSUE #787] artisan init fails using sql server #564

Closed
opened 2026-02-26 02:33:33 +03:00 by kerem · 1 comment
Owner

Originally created by @dotnetdan on GitHub (Aug 23, 2018).
Original GitHub issue: https://github.com/koel/koel/issues/787

Hi,

I'm trying to get up and running using sql server, on Windows 10.

When I run php artisan koel:init, the database seeding fails with errors saying "Cannot insert explicit value for identity column in table 'artists' when IDENTITY_INSERT is set to OFF"

In sql server, you cannot insert explicit values into an identity column unless explicitly request permission to do so, by running SET IDENTITY_INSERT dbo.artists OFF; - not sure if Laravel supports this? Has anyone gotten this running using SQL Server?

c:\Users\Otter\Source\koel>php artisan koel:init
Attempting to install or upgrade Koel.
Remember, you can always install/upgrade manually following the guide here:
📙  https://koel.phanan.net/docs

App key exists -- skipping
JWT secret exists -- skipping
Migrating database

In Connection.php line 647:

  SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN
  SERT is set to OFF. (SQL: insert into [artists] ([id], [name], [updated_at], [created_at]) values (2, Various Artists, 2018-08-23 02:15:28.000, 2018-08-23
  02:15:28.000))


In PDOStatement.php line 107:

  SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN
  SERT is set to OFF.


In PDOStatement.php line 105:

  SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN
  SERT is set to OFF.
Originally created by @dotnetdan on GitHub (Aug 23, 2018). Original GitHub issue: https://github.com/koel/koel/issues/787 Hi, I'm trying to get up and running using sql server, on Windows 10. When I run php artisan koel:init, the database seeding fails with errors saying "Cannot insert explicit value for identity column in table 'artists' when IDENTITY_INSERT is set to OFF" In sql server, you cannot insert explicit values into an identity column unless explicitly request permission to do so, by running `SET IDENTITY_INSERT dbo.artists OFF;` - not sure if Laravel supports this? Has anyone gotten this running using SQL Server? ``` c:\Users\Otter\Source\koel>php artisan koel:init Attempting to install or upgrade Koel. Remember, you can always install/upgrade manually following the guide here: 📙 https://koel.phanan.net/docs App key exists -- skipping JWT secret exists -- skipping Migrating database In Connection.php line 647: SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN SERT is set to OFF. (SQL: insert into [artists] ([id], [name], [updated_at], [created_at]) values (2, Various Artists, 2018-08-23 02:15:28.000, 2018-08-23 02:15:28.000)) In PDOStatement.php line 107: SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN SERT is set to OFF. In PDOStatement.php line 105: SQLSTATE[23000]: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Cannot insert explicit value for identity column in table 'artists' when IDENTITY_IN SERT is set to OFF. ```
kerem closed this issue 2026-02-26 02:33:34 +03:00
Author
Owner

@dotnetdan commented on GitHub (Aug 25, 2018):

I switched to mysql. I guess I'll close this, since I think it might be more of an issue with Laravel.

<!-- gh-comment-id:415938472 --> @dotnetdan commented on GitHub (Aug 25, 2018): I switched to mysql. I guess I'll close this, since I think it might be more of an issue with Laravel.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/koel-koel#564
No description provided.