<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 数据类型?

        Does SQL Server 2005 have an equivalent to MySql#39;s ENUM data type?(SQL Server 2005 是否具有等效于 MySql 的 ENUM 数据类型?)

          <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 数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Why Mysql#39;s Group By and Oracle#39;s Group by behaviours are different(为什么 Mysql 的 Group By 和 Oracle 的 Group by 行为不同)
                  MySQL GROUP BY DateTime +/- 3 seconds(MySQL GROUP BY DateTime +/- 3 秒)

                      <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>
                      • <tfoot id='nCxqQ'></tfoot>
                          <tbody id='nCxqQ'></tbody>
                        • <legend id='nCxqQ'><style id='nCxqQ'><dir id='nCxqQ'><q id='nCxqQ'></q></dir></style></legend>