Skip to content

Latest commit

 

History

History
51 lines (47 loc) · 2.47 KB

File metadata and controls

51 lines (47 loc) · 2.47 KB
title Default SQL Server Data Types | Microsoft Docs
ms.custom
ms.date 01/19/2017
ms.prod sql-non-specified
ms.prod_service drivers
ms.service
ms.component php
ms.reviewer
ms.suite sql
ms.technology
drivers
ms.tgt_pltfrm
ms.topic article
helpviewer_keywords
default data types
converting data types
ms.assetid 65c7c211-96d3-4e65-a1de-1fe8d21348e7
caps.latest.revision 20
author MightyPen
ms.author genemi
manager jhubbard
ms.workload Inactive

Default SQL Server Data Types

[!INCLUDEDriver_PHP_Download]

When sending data to the server, the [!INCLUDEssDriverPHP] converts data from its PHP data type to a SQL Server data type if no SQL Server data type has been specified by the user. The table that follows lists the PHP data type (the data type being sent to the server) and the default SQL Server data type (the data type to which the data is converted). For details about how to specify data types when sending data to the server, see How to: Specify SQL Server Data Types When Using the SQLSRV Driver.

PHP Data Type Default SQL Server Type in the SQLSRV Driver Default SQL Server Type in the PDO_SQLSRV Driver
NULL varchar(1) not supported
Boolean bit bit
Integer int int
Float float(24) not supported
String (length less than 8000 bytes) varchar() varchar()
String (length greater than 8000 bytes) varchar(max) varchar(max)
Resource Not supported. Not supported.
Stream (encoding: not binary) varchar(max) varchar(max)
Stream (encoding: binary) varbinary varbinary
Array Not supported. Not supported.
Object Not supported. Not supported.
DateTime (1) datetime Not supported.

See Also

Constants (Microsoft Drivers for PHP for SQL Server)
Converting Data Types
sqlsrv_field_metadata
PHP Types
Data Types (Transact-SQL)