From 332b6fabd5f3324555ff25a522a0a211477a3e70 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 1 Dec 2005 21:01:06 +0000 Subject: [PATCH] fix for mssql problem reported, without SET identity_update ON, mssql refuses to change the identity column (create negative group id). I cant test it, as I have no MsSQL at the moment. --- phpgwapi/inc/class.accounts_sql.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index eddca5212f..79f45f2174 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -323,6 +323,10 @@ if ($account_info['account_type'] == 'g' && $id > 0) // create negative id for groups { + if ($this->db->Type == 'mssql') + { + $this->db->query("SET identity_update $this->table ON",__LINE__,__FILE__); + } $this->db->update($this->table,array('account_id' => -$id),array('account_id' => $id),__LINE__,__FILE__); return -$id; }