Category : sql-server

I am getting the following error: SQLSTATE[42S22]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name ’employee’. (SQL: insert into [records] ([category_ID], [subcategory_ID], [employee], [fileDate], [notes], [disposalType], [fileType], [employeeSignature], [status], [updated_at], [created_at]) values (9, 57, test, , testing functionality, test, test, test, 1, 2020-09-16 19:35:37.200, 2020-09-16 19:35:37.200)) As you can see there are no quotes ..

Read more

In my laravel app, I’d like to get the comments for all the columns of a given SQL Server table. This is what I’ve tried so far: $query = "SELECT sys.objects.name AS TableName, sys.columns.name AS ColumnName, ep.name AS PropertyName, ep.value AS Description FROM sys.objects INNER JOIN sys.columns ON sys.objects.object_id = sys.columns.object_id CROSS APPLY fn_listextendedproperty(default, ‘SCHEMA’, ..

Read more

I’m calling SQL Server 2005 Stored Procedure from Laraven 5.8. it returns values if run on windows (10), but return empty array if run on ubuntu (18.04). $mcu_hasil_lab = DB::connection($unit_url . ‘_api_proitweb’) ->select( ‘SET ANSI_NULLS ON; SET ANSI_WARNINGS ON; EXEC splbrpt_Cetak_Hasil_MCU_new ?,?,?’, array($nobukti, ’03’, ”) ); I’ve also checked that the query is running on ..

Read more

I am grateful for this package it really did helped me on my project. but the problem is that I can’t migrate the table which is provided when I installed the laravelista/comments. create_comments_table.php class CreateCommentsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create(‘comments’, function (Blueprint ..

Read more

I have two Laravel Applications hosted on the same Server. For Example. dev.example.com and staging.example.com Both sites provide APIs that are accessed by VUEJS sites devfh.example.com and stagingfh.example.com. Both these sites work well, however, occasionally/randomly we get staging data in dev site and dev data in a staging site. We are using the following technology ..

Read more

I’m getting this syntax error when I am trying to use this code in my laravel application. The code is as follow: $allIndexes = DB::select ( ‘ SELECT OBJECT_NAME(ic.OBJECT_ID) AS TableName, i.name AS IndexName, COL_NAME(ic.OBJECT_ID,ic.column_id) AS ColumnName, case when i.is_primary_key = 1 then ‘Primary_key’ when i.is_unique = 1 then ‘Unique’ else ‘Not_unique’ end as [type], ..

Read more

I am trying to view all foreign keys of my database and I have the following code to do that: SELECT tc.TABLE_NAME, sc.COLUMN_NAME, CONSTRAINT_NAME, CONSTRAINT_TYPE FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS as tc inner join INFORMATION_SCHEMA.COLUMNS as sc on sc.TABLE_NAME = tc.TABLE_NAME order by tc.TABLE_NAME But it seems to give more results than it should be. It gives around ..

Read more

In Codeigniter, I used to use $this->db->where(‘sha1(id)’, $id); How can I achieve this in Laravel? DB::table(”)->where(‘sha1(id)’, $id); ? DB::table(”)->whereRaw(“sha1(id) = ‘$id'”); ? If I’m about to use Laravel Hash facade, how can I achieve it? DB::table(”)->where(‘Hash::make(id)’, $id); My main goal is to searching into table where hash(id -> from table) = $id -> (method param) ..

Read more

I have problem when I use method updateOrCreate in SQL Server Here is my code McuDiagnosisResult::updateOrCreate([ [ ‘diagnostic_code’ => $request->diagnostic_code, ‘no_reg’ => trim($request->no_reg) ], [ ‘remarks’ => $request->remarks, ‘diagnostic_result’ => $request->diagnostic_result, ‘created_by’ => trim($user_id), ‘updated_by’ => trim($user_id) ] ]); But when I execute this code it shows an error like this SQLSTATE[42000]: [Microsoft][ODBC Driver 13 ..

Read more