TransWikia.com

MsSql Grammar quoteString don't auto add 'N'

Stack Overflow Asked by Jay Chu on December 7, 2021

I use Laravel 5.8 to insert row to MsSQL database

Model::insert([
  'name' => '中文字'
]);

The output SQL is

insert into table_name (name) values ('中文字')

But it’s miss N char before string character.
How to set N before string character by auto. Like this

insert into table_name (name) values (N'中文字')

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP