I’m working in a existing MS SQL database with Collation as SQL_Latin1_General_CP1_CI_AS. The target column data type has been updated to NVARCHAR(MAX) and set collation to Arabic_CI_AI_KS_WS. Using the stored procedure to insert/update row the NVARCHAR(MAX) data type has been setup. The stored procedure is saving but the data is not in the correct format.
MS SQL MODIFY TARGET COLUMN
ALTER TABLE myTable ALTER COLUMN cLineNotes nvarchar(max) COLLATE Arabic_CI_AI_KS_WS
MS SQL STORED PROCEDURE
CREATE PROCEDURE spMyProcedure
... --3 more lines here
@pcLineNotes nvarchar(max)
AS
BEGIN
SET NOCOUNT ON;
... -- more lines here
INSERT INTO myTable (cLineNotes ) VALUES (@pcLineNotes )
... -- more lines here
END
PHP Connection Info Using UTF-8
$connectionInfo = array("Database" => $this->db_name, "UID" => $this->db_user, "PWD" => $this->db_pwd , "CharacterSet" => "UTF-8");
PHP Stored Procedure Call
$query = "{CALL spMyProcedure( ?,?,?,? )}";
$params = array(
array($param1, SQLSRV_PARAM_IN,),
array(&$param2, SQLSRV_PARAM_IN),
array(&$param3, SQLSRV_PARAM_IN),
array(&$cLineNotes, SQLSRV_PARAM_IN)
);
Sample cLineNotes value is اختبار يونيكود and stored value in database ط§ط®طھط¨ط§ط± ظٹظˆظ†ظٹظƒظˆط¯