1
Query: $structure = DB::connection('sqlsrv')
    ->table('TB_USER')->insert([
    'sUserName' => 'testuser3',
    'nDepartmentIdn' => 15,
    'sTelNumber' => 59281292,
    'nStartDate' => 1482059457,
    'nEndDate' => 1945244457,
    'sEmail' => '[email protected]',
    'bal' => 0,
    'lm' => 0,
    'dlm' => 0,
    'lmdt' => '12/18/2016',
    'bPassword2' => 1234
]);

Error: SQLSTATE[HY000]: General error: 20018 Implicit conversion from data type varchar to binary is not allowed. Use the CONVERT function to run this query. [20018] (severity 16) [(null)] (SQL: insert into [TB_USER] ([sUserName], [nDepartmentIdn], [sTelNumber], [nStartDate], [nEndDate], [sEmail], [bal], [lm], [dlm], [lmdt], [bPassword2]) values (testuser3, 15, 59281292, 1482059457, 1945244457, [email protected], 0, 0, 0, 12/18/2016, 123456))

1 Answer 1

1

One of the columns has binary type, but you're trying to insert string. Set this column to varchar or convert value to binary to fix this.

Sign up to request clarification or add additional context in comments.

2 Comments

Error is because bPassword2 column type is binary not boolean.
Oh yeah, it's binary. Well, you got the idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.