Class FOFDatabaseDriverSqlsrv
	
	
SQL Server database driver
	 
	
		- 
			FOFDatabase
			
			
			
		
- 
			 FOFDatabaseDriver
			
			 implements 
				FOFDatabaseInterface FOFDatabaseDriver
			
			 implements 
				FOFDatabaseInterface
- 
			 FOFDatabaseDriverSqlsrv FOFDatabaseDriverSqlsrv
Methods summary
		
		
			| 
				 public static
				boolean
				
				 | 
			#
			isSupported( )
				
Test to see if the SQLSRV connector is available. 
				
Test to see if the SQLSRV connector is available. Returns
						boolean- True on success, false otherwise.
 Since
							12.1
 | 
		
			| 
				 public 
				
				
				 | 
			#
			__construct( array $options )
				
Constructor. Parameters
						$optionsarray- $options List of options used to configure the connectionSince
							12.1
 Overrides | 
		
			| 
				 public 
				
				
				 |  | 
		
			| 
				 public 
				
				
				 | 
			#
			connect( )
				
Connects to the database if needed. 
				
Connects to the database if needed. Returns
						- Returns void if the database connected successfully.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				
				
				 | 
			#
			disconnect( )
				
Disconnects the database. 
				
Disconnects the database. Since
							12.1
 | 
		
			| 
				 protected 
				array
				
				 | 
			#
			getTableConstraints( string $tableName )
				
Get table constraints Parameters
						$tableNamestring- $tableName The name of the database table.Returns
						array- Any constraints available for the table.
 Since
							12.1
 | 
		
			| 
				 protected 
				
				
				 | 
			#
			renameConstraints( array $constraints = array(), string $prefix = null, string $backup = null )
				
Rename constraints. Parameters
						$constraintsarray- $constraints Array(strings) of table constraints$prefixstring- $prefix A string$backupstring- $backup A stringSince
							12.1
 | 
		
			| 
				 public 
				string
				
				 | 
			#
			escape( string $text, boolean $extra = false )
				
Method to escape a string for usage in an SQL statement. 
				
Method to escape a string for usage in an SQL statement. The escaping for MSSQL isn't handled in the driver though that would be nice.
Because of this we need to handle the escaping ourselves. Parameters
						$textstring- $text The string to be escaped.$extraboolean- $extra Optional parameter to provide extra escaping.Returns
						string- The escaped string.
 Since
							12.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			connected( )
				
Determines if the connection to the server is active. 
				
Determines if the connection to the server is active. Returns
						boolean- True if connected to the database engine.
 Since
							12.1
 | 
		
			| 
				 public 
				FOFDatabaseDriverSqlsrv | 
			#
			dropTable( string $tableName, boolean $ifExists = true )
				
Drops a table from the database. 
				
Drops a table from the database. Parameters
						$tableNamestring- $tableName The name of the database table to drop.$ifExistsboolean- $ifExists Optionally specify that the table must exist before it is dropped.ReturnsThrowsSince
							12.1
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getAffectedRows( )
				
Get the number of affected rows for the previous executed SQL statement. 
				
Get the number of affected rows for the previous executed SQL statement. Returns
						integer- The number of affected rows.
 Since
							12.1
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getCollation( )
				
Method to get the database collation in use by sampling a text field of a
table in the database. 
				
Method to get the database collation in use by sampling a text field of a
table in the database. Returns
						mixed- The collation in use by the database or boolean false if not supported.
 Since
							12.1
 | 
		
			| 
				 public 
				string
				
				 | 
			#
			getConnectionCollation( )
				
Method to get the database connection collation, as reported by the driver.
If the connector doesn't support reporting this value please return an empty
string. 
				
Method to get the database connection collation, as reported by the driver.
If the connector doesn't support reporting this value please return an empty
string. Returns
						string
 Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getNumRows( resource $cursor = null )
				
Get the number of returned rows for the previous executed SQL statement. 
				
Get the number of returned rows for the previous executed SQL statement. Parameters
						$cursorresource- $cursor An optional database cursor resource to extract the row count from.Returns
						integer- The number of returned rows.
 Since
							12.1
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getTableColumns( mixed $table, boolean $typeOnly = true )
				
Retrieves field information about the given tables. 
				
Retrieves field information about the given tables. Parameters
						$tablemixed- $table A table name$typeOnlyboolean- $typeOnly True to only return field types.Returns
						array- An array of fields.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getTableCreate( mixed $tables )
				
Shows the table CREATE statement that creates the given tables. 
				
Shows the table CREATE statement that creates the given tables. This is unsupported by MSSQL. Parameters
						$tablesmixed- $tables A table name or a list of table names.Returns
						array- A list of the create SQL for the tables.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getTableKeys( string $table )
				
Get the details list of keys for a table. 
				
Get the details list of keys for a table. Parameters
						$tablestring- $table The name of the table.Returns
						array- An array of the column specification for the table.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getTableList( )
				
Method to get an array of all tables in the database. 
				
Method to get an array of all tables in the database. Returns
						array- An array of all the tables in the database.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				string
				
				 | 
			#
			getVersion( )
				
Get the version of the database connector. 
				
Get the version of the database connector. Returns
						string- The database connector version.
 Since
							12.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			insertObject( string $table, object & $object, string $key = null )
				
Inserts a row into a table based on an object's properties. 
				
Inserts a row into a table based on an object's properties. Parameters
						$tablestring- $table The name of the database table to insert into.$objectobject- &$object A reference to an object whose public properties match the table
fields.$keystring- $key The name of the primary key. If provided the object property is updated.Returns
						boolean- True on success.
 ThrowsSince
							12.1
 Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			insertid( )
				
Method to get the auto-incremented value from the last INSERT statement. 
				
Method to get the auto-incremented value from the last INSERT statement. Returns
						integer- The value of the auto-increment field from the last inserted row.
 Since
							12.1
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			loadResult( )
				
Method to get the first field of the first row of the result set from the
database query. 
				
Method to get the first field of the first row of the result set from the
database query. Returns
						mixed- The return value or null if the query failed.
 ThrowsSince
							12.1
 Overrides | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			execute( )
				
Execute the SQL statement. 
				
Execute the SQL statement. Returns
						mixed- A database cursor resource on success, boolean false on failure.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				string
				
				 | 
			#
			replacePrefix( string $query, string $prefix = '#__' )
				
This function replaces a string identifier $prefix with the string
held is the tablePrefix class variable. 
				
This function replaces a string identifier $prefix with the string
held is the tablePrefix class variable. Parameters
						$querystring- $query The SQL statement to prepare.$prefixstring- $prefix The common table prefix.Returns
						string- The processed SQL statement.
 Since
							12.1
 Overrides | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			select( string $database )
				
Select a database for use. 
				
Select a database for use. Parameters
						$databasestring- $database The name of the database to select for use.Returns
						boolean- True if the database was successfully selected.
 ThrowsSince
							12.1
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			setUtf( )
				
Set the connection to use UTF-8 character encoding. 
				
Set the connection to use UTF-8 character encoding. Returns
						boolean- True on success.
 Since
							12.1
 | 
		
			| 
				 public 
				
				
				 | 
			#
			transactionCommit( boolean $toSavepoint = false )
				
Method to commit a transaction. 
				
Method to commit a transaction. Parameters
						$toSavepointboolean- $toSavepoint If true, commit to the last savepoint.ThrowsSince
							12.1
 | 
		
			| 
				 public 
				
				
				 | 
			#
			transactionRollback( boolean $toSavepoint = false )
				
Method to roll back a transaction. 
				
Method to roll back a transaction. Parameters
						$toSavepointboolean- $toSavepoint If true, rollback to the last savepoint.ThrowsSince
							12.1
 | 
		
			| 
				 public 
				
				
				 | 
			#
			transactionStart( boolean $asSavepoint = false )
				
Method to initialize a transaction. 
				
Method to initialize a transaction. Parameters
						$asSavepointboolean- $asSavepoint If true and a transaction is already active, a savepoint will be
created.ThrowsSince
							12.1
 | 
		
			| 
				 protected 
				mixed
				
				 | 
			#
			fetchArray( mixed $cursor = null )
				
Method to fetch a row from the result set cursor as an array. 
				
Method to fetch a row from the result set cursor as an array. Parameters
						$cursormixed- $cursor The optional result set cursor from which to fetch the row.Returns
						mixed- Either the next row from the result set or false if there are no more rows.
 Since
							12.1
 | 
		
			| 
				 protected 
				mixed
				
				 | 
			#
			fetchAssoc( mixed $cursor = null )
				
Method to fetch a row from the result set cursor as an associative array. 
				
Method to fetch a row from the result set cursor as an associative array. Parameters
						$cursormixed- $cursor The optional result set cursor from which to fetch the row.Returns
						mixed- Either the next row from the result set or false if there are no more rows.
 Since
							12.1
 | 
		
			| 
				 protected 
				mixed
				
				 | 
			#
			fetchObject( mixed $cursor = null, string $class = 'stdClass' )
				
Method to fetch a row from the result set cursor as an object. 
				
Method to fetch a row from the result set cursor as an object. Parameters
						$cursormixed- $cursor The optional result set cursor from which to fetch the row.$classstring- $class The class name to use for the returned row object.Returns
						mixed- Either the next row from the result set or false if there are no more rows.
 Since
							12.1
 | 
		
			| 
				 protected 
				
				
				 | 
			#
			freeResult( mixed $cursor = null )
				
Method to free up the memory used for the result set. 
				
Method to free up the memory used for the result set. Parameters
						$cursormixed- $cursor The optional result set cursor from which to fetch the row.Since
							12.1
 | 
		
			| 
				 protected 
				boolean
				
				 | 
			#
			checkFieldExists( string $table, string $field )
				
Method to check and see if a field exists in a table. 
				
Method to check and see if a field exists in a table. Parameters
						$tablestring- $table The table in which to verify the field.$fieldstring- $field The field to verify.Returns
						boolean- True if the field exists in the table.
 Since
							12.1
 | 
		
			| 
				 protected 
				string
				
				 | 
			#
			limit( string $query, integer $limit, integer $offset )
				
Method to wrap an SQL statement to provide a LIMIT and OFFSET behavior for
scrolling through a result set. 
				
Method to wrap an SQL statement to provide a LIMIT and OFFSET behavior for
scrolling through a result set. Parameters
						$querystring- $query The SQL statement to process.$limitinteger- $limit The maximum affected rows to set.$offsetinteger- $offset The affected row offset to set.Returns
						string- The processed SQL statement.
 Since
							12.1
 | 
		
			| 
				 public 
				FOFDatabaseDriverSqlsrv | 
			#
			renameTable( string $oldTable, string $newTable, string $backup = null, string $prefix = null )
				
Renames a table in the database. 
				
Renames a table in the database. Parameters
						$oldTablestring- $oldTable The name of the table to be renamed$newTablestring- $newTable The new name for the table.$backupstring- $backup Table prefix$prefixstring- $prefix For the table - used to rename constraints in non-mysql databasesReturnsThrowsSince
							12.1
 | 
		
			| 
				 public 
				FOFDatabaseDriverSqlsrv | 
			#
			lockTable( string $tableName )
				
Locks a table in the database. 
				
Locks a table in the database. Parameters
						$tableNamestring- $tableName The name of the table to lock.ReturnsThrowsSince
							12.1
 | 
		
			| 
				 public 
				FOFDatabaseDriverSqlsrv | 
			#
			unlockTables( )
				
Unlocks tables in the database. 
				
Unlocks tables in the database. ReturnsThrowsSince
							12.1
 | 
		
			| 
				 protected 
				integer
				
				 | 
			#
			getErrorNumber( )
				
Return the actual SQL Error number 
				
Return the actual SQL Error number Returns
						integer- The SQL Error number
 Since
							3.4.6
 | 
		
			| 
				 protected 
				string
				
				 | 
			#
			getErrorMessage( string $query )
				
Return the actual SQL Error message 
				
Return the actual SQL Error message Parameters
						$querystring- $query The SQL Query that failsReturns
						string- The SQL Error message
 Since
							3.4.6
 | 
		
		
		
			__call(), 
			addDisconnectHandler(), 
			alterDbCharacterSet(), 
			alterTableCharacterSet(), 
			convertUtf8mb4QueryToUtf8(), 
			createDatabase(), 
			getAlterDbCharacterSet(), 
			getAlterTableCharacterSet(), 
			getCallStacks(), 
			getConnection(), 
			getConnectors(), 
			getCount(), 
			getCreateDatabaseQuery(), 
			getDatabase(), 
			getDateFormat(), 
			getExporter(), 
			getImporter(), 
			getInstance(), 
			getIterator(), 
			getLog(), 
			getMinimum(), 
			getName(), 
			getNullDate(), 
			getPrefix(), 
			getQuery(), 
			getServerType(), 
			getTimings(), 
			getUTFSupport(), 
			hasUTF8mb4Support(), 
			hasUTFSupport(), 
			isMinimumVersion(), 
			loadAssoc(), 
			loadAssocList(), 
			loadColumn(), 
			loadNextObject(), 
			loadNextRow(), 
			loadObject(), 
			loadObjectList(), 
			loadRow(), 
			loadRowList(), 
			quote(), 
			quoteName(), 
			quoteNameStr(), 
			setDebug(), 
			setQuery(), 
			splitSql(), 
			truncateTable(), 
			updateObject()
		
		Methods inherited from FOFDatabase
		
			getErrorMsg(), 
			getErrorNum(), 
			query(), 
			stderr(), 
			test()
		
		Magic methods summary
		
		
			q(), 
			qn()
		
		Properties summary
		
		
			| 
				public  
				string
			 | $name | 
				#
				
					
The name of the database driver. 
					
The name of the database driver. Since
								12.1
 | 
		
			| 
				public  
				string
			 | $serverType | 
				#
				
					
The type of the database server family supported by this driver. 
					
The type of the database server family supported by this driver. Since
								CMS 3.5.0
 | 
		
			| 
				protected  
				string
			 | $nameQuote | 
				#
				
					
The character(s) used to quote SQL statement names such as table names or
field names, etc. The child classes should define this as necessary. If a single
character string the same character is used for both sides of the quoted name,
else the first character will be used for the opening quote and the second for
the closing quote. 
					
The character(s) used to quote SQL statement names such as table names or
field names, etc. The child classes should define this as necessary. If a single
character string the same character is used for both sides of the quoted name,
else the first character will be used for the opening quote and the second for
the closing quote. Since
								12.1
 | 
		
			| 
				protected  
				string
			 | $nullDate | 
				#
				
					
The null or zero representation of a timestamp for the database driver. This
should be defined in child classes to hold the appropriate value for the
engine. 
					
The null or zero representation of a timestamp for the database driver. This
should be defined in child classes to hold the appropriate value for the
engine. Since
								12.1
 | 
		
			| 
				protected static 
				string
			 | $dbMinimum | 
				#
				
					
The minimum supported database version. 
					
The minimum supported database version. Since
								12.1
 | 
		
		
		
			$callStacks, 
			$connection, 
			$count, 
			$cursor, 
			$debug, 
			$disconnectHandlers, 
			$errorMsg, 
			$errorNum, 
			$instances, 
			$limit, 
			$log, 
			$offset, 
			$options, 
			$sql, 
			$tablePrefix, 
			$timings, 
			$transactionDepth, 
			$utf, 
			$utf8mb4