<bdo id='FUK8e'></bdo><ul id='FUK8e'></ul>
  • <i id='FUK8e'><tr id='FUK8e'><dt id='FUK8e'><q id='FUK8e'><span id='FUK8e'><b id='FUK8e'><form id='FUK8e'><ins id='FUK8e'></ins><ul id='FUK8e'></ul><sub id='FUK8e'></sub></form><legend id='FUK8e'></legend><bdo id='FUK8e'><pre id='FUK8e'><center id='FUK8e'></center></pre></bdo></b><th id='FUK8e'></th></span></q></dt></tr></i><div id='FUK8e'><tfoot id='FUK8e'></tfoot><dl id='FUK8e'><fieldset id='FUK8e'></fieldset></dl></div>
  • <tfoot id='FUK8e'></tfoot>

      1. <legend id='FUK8e'><style id='FUK8e'><dir id='FUK8e'><q id='FUK8e'></q></dir></style></legend>

        <small id='FUK8e'></small><noframes id='FUK8e'>

        SQL Server 2005 是否具有等效于 MySql 的 ENUM 数据类型?

        时间:2024-04-15

          <tfoot id='al16g'></tfoot>
            • <small id='al16g'></small><noframes id='al16g'>

                  <tbody id='al16g'></tbody>
                • <bdo id='al16g'></bdo><ul id='al16g'></ul>
                  <legend id='al16g'><style id='al16g'><dir id='al16g'><q id='al16g'></q></dir></style></legend>

                  <i id='al16g'><tr id='al16g'><dt id='al16g'><q id='al16g'><span id='al16g'><b id='al16g'><form id='al16g'><ins id='al16g'></ins><ul id='al16g'></ul><sub id='al16g'></sub></form><legend id='al16g'></legend><bdo id='al16g'><pre id='al16g'><center id='al16g'></center></pre></bdo></b><th id='al16g'></th></span></q></dt></tr></i><div id='al16g'><tfoot id='al16g'></tfoot><dl id='al16g'><fieldset id='al16g'></fieldset></dl></div>
                • 本文介绍了SQL Server 2005 是否具有等效于 MySql 的 ENUM 数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在处理一个项目,我想在表中存储一些易于枚举的信息.MySql 的枚举数据类型正是我想要的:http://dev.mysql.com/doc/refman/5.0/en/enum.html .SQL Server 2005 中是否有等价物?

                  I'm working on a project and I want to store some easily enumerated information in a table. MySql's enum data type does exactly what I want: http://dev.mysql.com/doc/refman/5.0/en/enum.html . Is there an equivalent in SQL Server 2005?

                  我知道我可以用一个键将可能的值存储在一个类型表中,但我宁愿不必链接回它来进行描述.我们的数据库标准不允许我们在非整数或唯一标识符字段上进行链接,因此也无法将可能的键存储为字符.

                  I know I could store the possible values in a type table with a key, but I'd rather not have to link back to it for descriptions. Our database standards don't allow us to link on non-integer or uniqueidentifier fields, so storing the possible keys as characters is out as well.

                  推荐答案

                  这对您有用吗?

                  来自 http://blechie.com/wtilton/archive/2007/08/24/303.aspx

                  创建表...

                  MySQL:

                  ColumnName ENUM('upload', 'open', 'close', 'delete', 'edit', 'add')
                     DEFAULT 'open'
                  

                  SQL Server:

                  ColumnName varchar(10) 
                     CHECK(ColumnName IN ('upload', 'open', 'close', 'delete', 'edit', 'add')) 
                     DEFAULT 'open'
                  

                  这篇关于SQL Server 2005 是否具有等效于 MySql 的 ENUM 数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Zend_Db 按字段值排序 下一篇:将 MySQL 数据类型的值限制在特定范围内(最好不是 ENUM)

                  相关文章

                      <small id='nCxqQ'></small><noframes id='nCxqQ'>

                      • <bdo id='nCxqQ'></bdo><ul id='nCxqQ'></ul>
                      <i id='nCxqQ'><tr id='nCxqQ'><dt id='nCxqQ'><q id='nCxqQ'><span id='nCxqQ'><b id='nCxqQ'><form id='nCxqQ'><ins id='nCxqQ'></ins><ul id='nCxqQ'></ul><sub id='nCxqQ'></sub></form><legend id='nCxqQ'></legend><bdo id='nCxqQ'><pre id='nCxqQ'><center id='nCxqQ'></center></pre></bdo></b><th id='nCxqQ'></th></span></q></dt></tr></i><div id='nCxqQ'><tfoot id='nCxqQ'></tfoot><dl id='nCxqQ'><fieldset id='nCxqQ'></fieldset></dl></div>
                    1. <tfoot id='nCxqQ'></tfoot>
                    2. <legend id='nCxqQ'><style id='nCxqQ'><dir id='nCxqQ'><q id='nCxqQ'></q></dir></style></legend>