我正在使用mssql_query
連接到現有的SQL Server 2008數據庫。使用mssql_query更新數據庫時出錯
SELECT
querys都OK,但是當我運行UPDATE
querys這樣的:
mssql_query("UPDATE TABLENAME SET fieldname = 1 WHERE Pk = '".$pk."'");
我得到這個錯誤:
UPDATE failed because the following SET options have incorrect settings: 'ANSI_NULLS, QUOTED_IDENTIFIER, CONCAT_NULL_YIELDS_NULL, ANSI_WARNINGS, ANSI_PADDING'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations. (severity 16)
這裏是我的連接代碼數據庫:
$server = 'SRVSQL';
// Connect to MSSQL
$link = mssql_connect($server, 'xx', 'xxxxxx');
if (!$link) {
die('Something went wrong while connecting to MSSQL');
}
$conn = mssql_select_db('xxxxxxx',$link);
謝謝SchmitzIT,解決我的問題。 – carlosduarte 2013-03-08 10:25:56
@carlosduarte - 你最歡迎:) – SchmitzIT 2013-03-08 10:33:03