Search found 3 matches: AlterColumnSQL

Searched query: +AlterColumnSQL

by AlexeiK
18 Jan 2016, 10:00
Forum: Customizations
Topic: SYSTEM NOTICE, Error Description
Replies: 31
Views: 79868

Re: SYSTEM NOTICE, Error Description

... array( db_get_table( 'user' ), 'username C(255) '. $t_notnull .' DEFAULT " \'\' "' ) ); $g_upgrade[197] = array( 'AlterColumnSQL', array( db_get_table( 'user' ), 'realname C(255) '. $t_notnull .' DEFAULT " \'\' "' ) ); $g_upgrade[198] = array( 'AlterColumnSQL', array( db_get_table( 'user' ), 'password C(64) '. $t_notnull .' DEFAULT " \'\' "' ) ); $g_upgrade[199] = array( 'AlterColumnSQL', array( db_get_table( 'user' ), 'email C(255) '. $t_notnull .' DEFAULT " \'\' "' ) AlterColumnSQL', ...
by AlexeiK
18 Jan 2016, 06:58
Forum: Customizations
Topic: SYSTEM NOTICE, Error Description
Replies: 31
Views: 79868

Re: SYSTEM NOTICE, Error Description

... $flds, $tableflds='', $tableoptions='') { $tabname = $this->TableName ($tabname); $sql = array(); list($lines,$pkey) = $this->_GenFields($flds); foreach($lines as $v) { $sql[] = "ALTER TABLE $tabname $this->alterCol $v"; } return $sql; } */ that is why mantis 1.3 use default from adodb-datadict.inc.php in mantis 1.2 everything is ok about ALTERCOLUMNSSQL function in datadict-mssqlnative.inc.php i looked in adodb.master repository and there is no support for ALTERCOLUMNSQL toAlterColumnSQL($tabname, ...
by AlexeiK
15 Jan 2016, 09:37
Forum: Customizations
Topic: SYSTEM NOTICE, Error Description
Replies: 31
Views: 79868

Re: SYSTEM NOTICE, Error Description

... array( db_get_table( 'project' ), 'inherit_global L ' . $t_notnull . ' DEFAULT \'0\'' ) ); BAD ALTER TABLE mantis_project_table ALTER COLUMN inherit_global BIT DEFAULT 0 NOT NULL SQLState: 42000 Error Code: 156 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'DEFAULT'. MSSQL 2008 R2 i run 1.3 nighlty on my 1.2 db. Msg 5074, Level 16, State 1, Line 2 The object 'DF__mantis_pr__inher__4EFDAD20' is dependent on column 'inherit_global'. Msg 4922, Level 16, State 9, Line 2 ALTER TABLE ALTER COLUMN inherit_global failed because one or more objects access this column. thats why this alter cant by applied. the right way is: alter table mantis_project_table drop constraint DF__mantis_pr__inher__4EFDAD20 go alter table mantis_project_table alter column inherit_global BIT go alter table mantis_project_table add constraint DF__mantis_pr__inher__4EFDAD20 default 0 for inherit_global go drop needed constrain and after that alter column. so if column has constrain it must be dropped in own step. after that you can change column type. after that you can add constrain for DEFAULT value. here you can see some info: http://stackoverflow.com/questions/9299966/how-to-modify-datatype-of-a-column-with-a-default-value i have run 1.3 on new db on MSSQL 2008 R2. but it cant be installed because of column alters on columns that already has constrain. error is below. Schema step 65: AlterColumnSQL ( mantis_user_pref_table ) BAD ALTER TABLE mantis_user_pref_table ALTER COLUMN redirect_delay INT DEFAULT 0 NOT NULL SQLState: 42000 Error Code: 156 Message: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Incorrect syntax near the keyword 'DEFAULT'. here is why so: http://www.select-sql.com/mssql/how-to-alter-column-with-default-constraint-in-mssql.html it is because versions 2005 and later use another T-SQL commands. here some info: http://stackoverflow.com/questions/19783613/how-to-connect-to-mssql-2000-from-php-5-3-and-up about who is who. Q: how combobox "Type of database" makes ? because if i want to install mantis on MSSQL 2000 i need one version of "MS sql server native driver" if i want MSSQL 2005 and later i need "MS sql server native driver" same or higher version of the drivers. it will be good if i can enter connection string or choose version of driver. on my windows i have two "MS sql server native driver" from 2008 R2 and 2012. mantis 1.3 uses 2012(which is ODBC Driver 11 for SQL Server) and i can`t connect to sql server 2000 by this way. here is some explanation about drivers for MS SQL servers: http://stackoverflow.com/questions/5343428/sql-server-native-client-vs-odAlterColumnSQL', ...