src/Connection/MsSql.php
public function primaryKey ($tableName)
		{
			if (! isset($this->primaryKeys[$tableName])) {
				$sql = "SELECT *
					    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
					        JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name
					    WHERE tc.CONSTRAINT_TYPE = 'Primary Key'
					        AND tc.TABLE_NAME = " . $this->quote($tableName);

				$keyResult                      = $this->query($sql);
				$key                            = $keyResult->fetchRow();
				$this->primaryKeys[$tableName]  = $key['COLUMN_NAME'];
			}

			return $this->primaryKeys[$tableName];
		}
public function primaryKey ($tableName)
		{
			if (! isset($this->primaryKeys[$tableName])) {
				$sql = "SELECT *
					    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
					        JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name
					    WHERE tc.CONSTRAINT_TYPE = 'Primary Key'
					        AND tc.TABLE_NAME = " . $this->quote($tableName);

				$keyResult                      = $this->query($sql);
				$key                            = $keyResult->fetchRow();
				$this->primaryKeys[$tableName]  = $key['COLUMN_NAME'];
			}

			return $this->primaryKeys[$tableName];
		}
public function primaryKey ( $ tableName ) { if ( ! isset ( $ this -> primaryKeys [ $ tableName ] ) ) { $ sql = "SELECT *
					    FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc
					        JOIN INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE ccu ON tc.CONSTRAINT_NAME = ccu.Constraint_name
					    WHERE tc.CONSTRAINT_TYPE = 'Primary Key'
					        AND tc.TABLE_NAME = " . $ this -> quote ( $ tableName ) ; $ keyResult = $ this -> query ( $ sql ) ; $ key = $ keyResult -> fetchRow ( ) ; $ this -> primaryKeys [ $ tableName ] = $ key [ 'COLUMN_NAME' ] ; } return $ this -> primaryKeys [ $ tableName ] ; }
primaryKey function.

@access public

@param string $tableName

@return string
primaryKey function .