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
[Illuminate\Database\QueryException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'user'. (SQL: if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table user)
[PDOException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'user'.
I think the problem is SQL query says
"if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table user" and user happens to be a keyword in SQL Server.
it should add square brackets to the table name right? as in
"if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table [user]"
pls confirm if this happens to others?
(edit... btw i was using this function in Laravel 5.2)
Schema::dropIfExists('user');
The text was updated successfully, but these errors were encountered:
I keep getting this error
[Illuminate\Database\QueryException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'user'. (SQL: if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table user)
[PDOException]
SQLSTATE[42000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'user'.
I think the problem is SQL query says
"if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table user" and user happens to be a keyword in SQL Server.
it should add square brackets to the table name right? as in
"if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = 'user') drop table [user]"
pls confirm if this happens to others?
(edit... btw i was using this function in Laravel 5.2)
Schema::dropIfExists('user');
The text was updated successfully, but these errors were encountered: