Mam taki problem. Probuje wykonac nastepujacy fragment kodu wysylajacy INSERTa do MS SQL Server 2000.
[php:1:b3865d180a]<?php
for($i=0;$i<6;$i++){
$sql="insert into tp_temperatury(wypelniajacy,serwerownia,temperatura)
values('".$HTTP_COOKIE_VARS["currname"]."','Serwerownia 1p',".$temperatura[$i].")";
$result=mssql_query($sql);
$xxx=mssql_rows_affected($mssql_cid);
echo $sql."<br>";
}
?>[/php:1:b3865d180a]
W wyniku otrzymuje :
Warning: MS SQL message: INSERT statement conflicted with COLUMN CHECK constraint 'CK_tp_temperatury'. The conflict occurred in database 'helpdesk', table 'tp_temperatury', column 'serwerownia'. (severity 16) in d:rootwwwhelpdesktemperatury.php on line 26
Warning: MS SQL: Query failed in d:rootwwwhelpdesktemperatury.php on line 26
insert into tp_temperatury(wypelniajacy,serwerownia,temperatura) values('test','Serwerownia 1p',11)
W bazie mam pozakladane constraints na kolumne serwerownia:
([serwerownia] = 'Serwerownia 1p' or ([serwerownia] = 'UPS' or ([serwerownia] = 'Sun' or ([serwerownia] = 'NT' or ([serwerownia] = 'Telekomunikacyjna' or [serwerownia] = 'Archiwum optyczne')))))
wiec teoretycznie powinno
