throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',

/usr/local/nginx/html/yii-1.1.10/framework/db/CDbCommand.php(354)

342 return $n;

343 }

344 catch(Exception $e)

345 {

346 if($this->_connection->enableProfiling)

347 Yii::endProfile(‘system.db.CDbCommand.execute(’.$this->getText().’)’,‘system.db.CDbCommand.execute’);

348 $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;

349 $message = $e->getMessage();

350 Yii::log(Yii::t(‘yii’,‘CDbCommand::execute() failed: {error}. The SQL statement executed was: {sql}.’,

351 array(’{error}’=>$message, ‘{sql}’=>$this->getText().$par)),CLogger::LEVEL_ERROR,‘system.db.CDbCommand’);

352 if(YII_DEBUG)

353 $message .= '. The SQL statement executed was: '.$this->getText().$par;

354 throw new CDbException(Yii::t(‘yii’,‘CDbCommand failed to execute the SQL statement: {error}’,

355 array(’{error}’=>$message)),(int)$e->getCode(),$errorInfo);

356 }

357 }

358

359 /**

360 * Executes the SQL statement and returns query result.

361 * This method is for executing an SQL query that returns result set.

362 * @param array $params input parameters (name=>value) for the SQL execution. This is an alternative

363 * to {@link bindParam} and {@link bindValue}. If you have multiple input parameters, passing

364 * them in this way can improve the performance. Note that if you pass parameters in this way,

365 * you cannot bind parameters or values using {@link bindParam} or {@link bindValue}, and vice versa.

366 * binding methods and the input parameters this way can improve the performance.

用的是YII 连接SQLSERVER 2008 PHP Version 5.4.3 +nginx

2012/08/18 14:16:44 [error] [exception.CDbException] exception ‘CDbException’ with message ‘CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 544 General SQL Server error: Check messages from the SQL Server [544] (severity 16) [(null)]. The SQL statement executed was: INSERT INTO [dbo].[DL_Hotel_Info] ([Class1], [Class2], [Star], [SumRoom], [SumFloor], [HotelGroupID], [AccountType], [BankFlag], [BankMoney], [Contract], [Commend], [Breakfast], [SortID], [IsSearch], [IsDel], [ExbiAddID], [RecordDate], [UpdateDate], [TasteHotel], [aoyoRecommendLevel], [guaranty], [guarantyLevel], [guarantyMulty], [ID], [Name], [City], [LinkMan], [Address], [Tel], [Fax], [AccountDate], [WebSite], [Remarks1], [Around_Business], [HotelFrom]) VALUES (:yp0, :yp1, :yp2, :yp3, :yp4, :yp5, :yp6, :yp7, :yp8, :yp9, :yp10, :yp11, :yp12, :yp13, :yp14, :yp15, :yp16, :yp17, :yp18, :yp19, :yp20, :yp21, :yp22, :yp23, :yp24, :yp25, :yp26, :yp27, :yp28, :yp29, :yp30, :yp31, :yp32, :yp33, :yp34). Bound with :yp0=‘0’, :yp1=‘0’, :yp2=‘4’, :yp3=0, :yp4=0, :yp5=0, :yp6=2, :yp7=0, :yp8=‘0’, :yp9=1, :yp10=2, :yp11=1, :yp12=0, :yp13=1, :yp14=0, :yp15=0, :yp16=‘2012-08-18’, :yp17=‘2012-08-18’, :yp18=0, :yp19=0, :yp20=0, :yp21=0, :yp22=0, :yp23=10511, :yp24=‘北京万商花园酒店’, :yp25=4, :yp26=‘ahwAPI’, :yp27=‘石景山区银河大街一号’, :yp28=‘861068681199’, :yp29=‘861068686088’, :yp30=‘2012-08-18’, :yp31=‘www.mercure.com’, :yp32=’ 北馆。

酒之所。

(套)。

‘, :yp33=‘石景山区’, :yp34=38’ in /yii-1.1.10/framework/db/CDbCommand.php:354

下边是日志里的错误

$hotel = new Hotelinfo();

				$hotel->IsSearch = 1;


				$hotel->IsDel = false;


				$hotel->RecordDate = '2012-08-18';


				$hotel->UpdateDate = '2012-08-18';


				$hotel->HotelFrom = 38;


				$hotel->save();

这是写入数据库的语句,这个表里有很多字段,运行就报那个错误,可是直接运行语句是没有问题的,感觉应该是YII本身的BUG