The Data types reference sheet

本文详细介绍了SQL Server各版本支持的数据类型及其版本对应情况,包括整型、浮点型、日期时间、字符和二进制等类型,帮助开发者快速了解不同数据类型的适用场景。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The Data types reference sheet
The columns 8, 9, 10 shows what versions of SQL Server that supports the data type
  • 8 = SQL Server 2000
  • 9 = SQL Server 2005
  • 10 = SQL Server 2008
Datatype Min Max Storage 8 9 10 Type Notes
Bigint-2^632^63-18 bytes   Exact numeric 
Int-2,147,483,6482,147,483,6474 bytes   Exact numeric 
Smallint-32,76832,7672 bytes   Exact numeric 
Tinyint02551 bytes   Exact numeric 
Bit011 to 8 bit columns in the same table requires a total of 1 byte, 9 to 16 bits = 2 bytes, etc...   Exact numeric 
Decimal-10^38+110^38–1Precision 1-9 = 5 bytes, precision 10-19 = 9 bytes, precision 20-28 = 13 bytes, precision 29-38 = 17 bytes    Exact numericDecimal and numeric data type is exactly the same. Precision is the total number of digits. Scale is the number of decimals. For booth the minimum is 1 and the maximum is 38.
Numericno       
Money-2^63 / 100002^63-1 / 100008 bytes   Exact numeric 
Smallmoney-214,748.3648214,748.36474 bytes   Exact numeric 
Float-1.79E + 3081.79E + 3084 bytes when precision is less than 25 and 8 bytes when precision is 25 through 53   Approximate numericsPrecision is specified from 1 to 53.
Real-3.40E + 383.40E + 384 bytes   Approximate numericsPrecision is fixed to 7.
Datetime1753-01-01 00:00:00.0009999-12-31 23:59:59.9978 bytes   Date and timeIf you are running SQL Server 2008 and need milliseconds precision, use datetime2(3) instead to save 1 byte.
Smalldatetime 1900-01-01 00:002079-06-06 23:59    Date and time 
Date0001-01-019999-12-31 nono Date and time 
Time00:00:00.000000023:59:59.9999999 nono Date and timeSpecifying the precision is possible. TIME(3) will have milliseconds precision. TIME(7) is the highest and the default precision. Casting values to a lower precision will round the value.
Datetime20001-01-01 00:00:00.00000009999-12-31 23:59:59.9999999Presicion 1-2 = 6 bytes precision 3-4 = 7 bytes precision 5-7 = 8 bytesnono Date and timeCombines the date datatype and the time datatype into one. The precision logic is the same as for the time datatype.
Datetimeoffset0001-01-01 00:00:00.0000000 -14:009999-12-31 23:59:59.9999999 +14:00Presicion 1-2 = 8 bytes precision 3-4 = 9 bytes precision 5-7 = 10 bytesnono Date and timeIs a datetime2 datatype with the UTC offset appended.
Char0 chars8000 charsDefined width   Character stringFixed width
Varchar0 chars8000 chars2 bytes + number of chars   Character stringVariable width
Varchar(max)0 chars2^31 chars2 bytes + number of charsno  Character stringVariable width
Text0 chars2,147,483,647 chars4 bytes + number of chars   Character stringVariable width
Nchar0 chars4000 charsDefined width x 2   Unicode character stringFixed width
Nvarchar0 chars4000 chars    Unicode character stringVariable width
Nvarchar(max)0 chars2^30 chars no  Unicode character stringVariable width
Ntext0 chars1,073,741,823 chars    Unicode character stringVariable width
Binary0 bytes8000 bytes    Binary stringFixed width
Varbinary0 bytes8000 bytes    Binary stringVariable width
Varbinary(max)0 bytes2^31 bytes no  Binary stringVariable width
Image0 bytes2,147,483,647 bytes    Binary stringVariable width
Sql_variant      OtherStores values of various SQL Server-supported data types, except text, ntext, and timestamp.
Timestamp      OtherStores a database-wide unique number that gets updated every time a row gets updated.
Uniqueidentifier      OtherStores a globally unique identifier (GUID).
Xml   no  OtherStores XML data. You can store xml instances in a column or a variable.
Cursor      OtherA reference to a cursor.
Table      OtherStores a result set for later processing.
. The [libraries] section specifies all the input library data (see also Specifying Input FASTQ Files). Field Description fastq_id Required. The Illumina sample name to analyze. This will be as specified in the sample sheet supplied to the demultiplexing software. fastqs Required. Absolute path to the folder containing the FASTQ files to be analyzed. Generally, this will be the fastq_path folder generated by the demultiplexing software. If the same library was sequenced on multiple flow cells, the FASTQs folder from each flow cell must be specified a separate line in the CSV (see 5' example here). Doing this will treat all reads from the library, across flow cells, as one sample. If you have multiple libraries for the sample, you will need to run cellranger multi on them individually, and then combine them with cellranger aggr. feature_types Required. The underlying feature type of the library (listed below). lanes Optional. The lanes associated with this sample, separated with a pipe (e.g., 1|2). Default: uses all lanes physical_library_id Optional. Library type. Note: by default, the library type is detected automatically based on specified feature_types (recommended). Users typically do not need to include the physical_library_id column in the CSV file. subsample_rate Optional. The rate at which reads from the provided FASTQ files are sampled. Must be strictly greater than 0 and less than or equal to 1. chemistry Optional (only applicable to Flex). Library-specific assay configuration. By default, the assay configuration is detected automatically (recommended). Typically, users will not need to specify a chemistry. However, options are available if needed (see chemistry options). Default: auto官网没有sample参数
最新发布
07-03
是在这个类中查看版本么namespace OpenXLSX { constexpr const char * XLXmlDefaultVersion = "1.0"; constexpr const char * XLXmlDefaultEncoding = "UTF-8"; constexpr const bool XLXmlStandalone = true; constexpr const bool XLXmlNotStandalone = false; /** * @brief The XLXmlSavingDeclaration class encapsulates the properties of an XML saving declaration, * that can be used in calls to XLXmlData::getRawData to enforce specific settings */ class OPENXLSX_EXPORT XLXmlSavingDeclaration { public: // ===== PUBLIC MEMBER FUNCTIONS ===== // XLXmlSavingDeclaration() : m_version(XLXmlDefaultVersion), m_encoding(XLXmlDefaultEncoding), m_standalone(XLXmlNotStandalone) {} XLXmlSavingDeclaration(XLXmlSavingDeclaration const & other) = default; // copy constructor XLXmlSavingDeclaration(std::string version, std::string encoding, bool standalone = XLXmlNotStandalone) : m_version(version), m_encoding(encoding), m_standalone(standalone) {} ~XLXmlSavingDeclaration() {} /** * @brief: getter functions: version, encoding, standalone */ std::string const & version() const { return m_version; } std::string const & encoding() const { return m_encoding; } bool standalone_as_bool() const { return m_standalone; } std::string const standalone() const { return m_standalone ? "yes" : "no"; } private: // ===== PRIVATE MEMBER VARIABLES ===== // std::string m_version; std::string m_encoding; bool m_standalone; }; /** * @brief The XLXmlData class encapsulates the properties and behaviour of the .xml files in an .xlsx file zip * package. Objects of the XLXmlData type are intended to be stored centrally in an XLDocument object, from where * they can be retrieved by other objects that encapsulates the behaviour of Excel elements, such as XLWorkbook * and XLWorksheet. */ class OPENXLSX_EXPORT XLXmlData final { public: // ===== PUBLIC MEMBER FUNCTIONS ===== // /** * @brief Default constructor. All member variables are default constructed. Except for * the raw XML data, none of the member variables can be modified after construction. Hence, objects created * using the default constructor can only serve as null objects and targets for the move assignemnt operator. */ XLXmlData() = default; /** * @brief Constructor. This constructor creates objects with the given parameters. the xmlId and the xmlType * parameters have default values. These are only useful for relationship (.rels) files and the * [Content_Types].xml file located in the root directory of the zip package. * @param parentDoc A pointer to the parent XLDocument object. * @param xmlPath A std::string with the file path in zip package. * @param xmlId A std::string with the relationship ID of the file (used in the XLRelationships class) * @param xmlType The type of object the XML file represents, e.g. XLWorkbook or XLWorksheet. */ XLXmlData(XLDocument* parentDoc, const std::string& xmlPath, const std::string& xmlId = "", XLContentType xmlType = XLContentType::Unknown); /** * @brief Default destructor. The XLXmlData does not manage any dynamically allocated resources, so a default * destructor will suffice. */ ~XLXmlData(); /** * @brief check whether class is linked to a valid XML document * @return true if the class should have a link to valid data * @return false if accessing any other properties / methods could cause a segmentation fault */ bool valid() const { return m_xmlDoc != nullptr; } /** * @brief Copy constructor. The m_xmlDoc data member is a XMLDocument object, which is non-copyable. Hence, * the XLXmlData objects have a explicitly deleted copy constructor. * @param other */ XLXmlData(const XLXmlData& other) = delete; /** * @brief Move constructor. All data members are trivially movable. Hence an explicitly defaulted move * constructor is sufficient. * @param other */ XLXmlData(XLXmlData&& other) noexcept = default; /** * @brief Copy assignment operator. The m_xmlDoc data member is a XMLDocument object, which is non-copyable. * Hence, the XLXmlData objects have a explicitly deleted copy assignment operator. */ XLXmlData& operator=(const XLXmlData& other) = delete; /** * @brief Move assignment operator. All data members are trivially movable. Hence an explicitly defaulted move * constructor is sufficient. * @param other the XLXmlData object to be moved from. * @return A reference to the moved-to object. */ XLXmlData& operator=(XLXmlData&& other) noexcept = default; /** * @brief Set the raw data for the underlying XML document. Being able to set the XML data directly is useful * when creating a new file using a XML file template. E.g., when creating a new worksheet, the XML code for * a minimum viable XLWorksheet object can be added using this function. * @param data A std::string with the raw XML text. */ void setRawData(const std::string& data); /** * @brief Get the raw data for the underlying XML document. This function will retrieve the raw XML text data * from the underlying XMLDocument object. This will mainly be used when saving data to the .xlsx package * using the save function in the XLDocument class. * @param savingDeclaration @optional specify an XML saving declaration to use * @return A std::string with the raw XML text data. */ std::string getRawData(XLXmlSavingDeclaration savingDeclaration = XLXmlSavingDeclaration{}) const; /** * @brief Access the parent XLDocument object. * @return A pointer to the parent XLDocument object. */ XLDocument* getParentDoc(); /** * @brief Access the parent XLDocument object. * @return A const pointer to the parent XLDocument object. */ const XLDocument* getParentDoc() const; /** * @brief Retrieve the path of the XML data in the .xlsx zip archive. * @return A std::string with the path. */ std::string getXmlPath() const; /** * @brief Retrieve the relationship ID of the XML file. * @return A std::string with the relationship ID. */ std::string getXmlID() const; /** * @brief Retrieve the type represented by the XML data. * @return A XLContentType getValue representing the type. */ XLContentType getXmlType() const; /** * @brief Access the underlying XMLDocument object. * @return A pointer to the XMLDocument object. */ XMLDocument* getXmlDocument(); /** * @brief Access the underlying XMLDocument object. * @return A const pointer to the XMLDocument object. */ const XMLDocument* getXmlDocument() const; /** * @brief Test whether there is an XML file linked to this object * @return true if there is no underlying XML file, otherwise false */ bool empty() const; private: // ===== PRIVATE MEMBER VARIABLES ===== // XLDocument* m_parentDoc {}; /**< A pointer to the parent XLDocument object. >*/ std::string m_xmlPath {}; /**< The path of the XML data in the .xlsx zip archive. >*/ std::string m_xmlID {}; /**< The relationship ID of the XML data. >*/ XLContentType m_xmlType {}; /**< The type represented by the XML data. >*/ mutable std::unique_ptr<XMLDocument> m_xmlDoc; /**< The underlying XMLDocument object. >*/ }; } // namespace OpenXLSX
06-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值