Derek Allard | d2df9bc | 2007-04-15 17:41:17 +0000 | [diff] [blame^] | 1 | <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
|
| 2 | /**
|
| 3 | * CodeIgniter
|
| 4 | *
|
| 5 | * An open source application development framework for PHP 4.3.2 or newer
|
| 6 | *
|
| 7 | * @package CodeIgniter
|
| 8 | * @author Rick Ellis
|
| 9 | * @copyright Copyright (c) 2006, EllisLab, Inc.
|
| 10 | * @license http://www.codeignitor.com/user_guide/license.html
|
| 11 | * @link http://www.codeigniter.com
|
| 12 | * @since Version 1.0
|
| 13 | * @filesource
|
| 14 | */
|
| 15 |
|
| 16 | // ------------------------------------------------------------------------
|
| 17 |
|
| 18 | /**
|
| 19 | * MS SQL Utility Class
|
| 20 | *
|
| 21 | * @category Database
|
| 22 | * @author Rick Ellis
|
| 23 | * @link http://www.codeigniter.com/user_guide/database/
|
| 24 | */
|
| 25 | class CI_DB_mssql_utility extends CI_DB_utility {
|
| 26 |
|
| 27 |
|
| 28 | /**
|
| 29 | * Create database
|
| 30 | *
|
| 31 | * @access private
|
| 32 | * @param string the database name
|
| 33 | * @return bool
|
| 34 | */
|
| 35 | function _create_database($name)
|
| 36 | {
|
| 37 | return "CREATE DATABASE ".$name;
|
| 38 | }
|
| 39 |
|
| 40 | // --------------------------------------------------------------------
|
| 41 |
|
| 42 | /**
|
| 43 | * Drop database
|
| 44 | *
|
| 45 | * @access private
|
| 46 | * @param string the database name
|
| 47 | * @return bool
|
| 48 | */
|
| 49 | function _drop_database($name)
|
| 50 | {
|
| 51 | return "DROP DATABASE ".$name;
|
| 52 | }
|
| 53 |
|
| 54 | // --------------------------------------------------------------------
|
| 55 |
|
| 56 | /**
|
| 57 | * Drop Table
|
| 58 | *
|
| 59 | * @access private
|
| 60 | * @return bool
|
| 61 | */
|
| 62 | function _drop_table($table)
|
| 63 | {
|
| 64 | return "DROP TABLE ".$this->db->_escape_table($table);
|
| 65 | }
|
| 66 |
|
| 67 | // --------------------------------------------------------------------
|
| 68 |
|
| 69 | /**
|
| 70 | * List databases
|
| 71 | *
|
| 72 | * @access private
|
| 73 | * @return bool
|
| 74 | */
|
| 75 | function _list_databases()
|
| 76 | {
|
| 77 | return "EXEC sp_helpdb"; // Can also be: EXEC sp_databases
|
| 78 | }
|
| 79 |
|
| 80 | // --------------------------------------------------------------------
|
| 81 |
|
| 82 | /**
|
| 83 | * Optimize table query
|
| 84 | *
|
| 85 | * Generates a platform-specific query so that a table can be optimized
|
| 86 | *
|
| 87 | * @access private
|
| 88 | * @param string the table name
|
| 89 | * @return object
|
| 90 | */
|
| 91 | function _optimize_table($table)
|
| 92 | {
|
| 93 | return FALSE; // Is this supported in MS SQL?
|
| 94 | }
|
| 95 |
|
| 96 | // --------------------------------------------------------------------
|
| 97 |
|
| 98 | /**
|
| 99 | * Repair table query
|
| 100 | *
|
| 101 | * Generates a platform-specific query so that a table can be repaired
|
| 102 | *
|
| 103 | * @access private
|
| 104 | * @param string the table name
|
| 105 | * @return object
|
| 106 | */
|
| 107 | function _repair_table($table)
|
| 108 | {
|
| 109 | return FALSE; // Is this supported in MS SQL?
|
| 110 | }
|
| 111 |
|
| 112 | // --------------------------------------------------------------------
|
| 113 |
|
| 114 | /**
|
| 115 | * MSSQL Export
|
| 116 | *
|
| 117 | * @access private
|
| 118 | * @param array Preferences
|
| 119 | * @return mixed
|
| 120 | */
|
| 121 | function _backup($params = array())
|
| 122 | {
|
| 123 | // Currently unsupported
|
| 124 | return $this->db->display_error('db_unsuported_feature');
|
| 125 | }
|
| 126 |
|
| 127 |
|
| 128 | }
|
| 129 |
|
admin | 7b613c7 | 2006-09-24 18:05:17 +0000 | [diff] [blame] | 130 | ?> |