public function Scheme::functionExists in Drupal driver for SQL Server and SQL Azure 8.2
Find if a table function exists.
Parameters
$function: Name of the function.
Return value
True if the function exists, false otherwise.
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Scheme.php, line 627
Class
Namespace
Drupal\Driver\Database\sqlsrvCode
public function functionExists($function) {
// FN = Scalar Function
// IF = Inline Table Function
// TF = Table Function
// FS | AF = Assembly (CLR) Scalar Function
// FT | AT = Assembly (CLR) Table Valued Function
return $this->cnn
->query_execute("SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('" . $function . "') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT', N'AF')")
->fetchField() !== false;
}