

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Does SQL Server have an equivalent to MySQL's ENUM data type?
This works in MySQL version 8.0.12. The syntax is as follows.
create table yourTableName ( yourColumnName enum(‘Value1’,Value2’,Value3’,......N) default Value1’ or Value2 or Value3,..N );
Set the enum type in MySQL with the following query.
mysql> create table EnumInMySQL -> ( -> WebCRUD enum('CREATE','READ','UPDATE','DELETE') -> default 'CREATE' -> ); Query OK, 0 rows affected (0.60 sec)
The syntax of enum in SQL Server.
create table yourTableName ( yourColumnName varchar(100) CHECK(yourColumnName IN (‘Value1’,Value2’,Value3’,......N)) DEFAULT ‘Value1’ or Value2’ or Value3’,......N );
Now the query is as follows for enum in SQL Server.
- Related Questions & Answers
- MySQL LIMIT clause equivalent for SQL SERVER?
- Equivalent of SQL Server IDENTITY Column in MySQL?
- The equivalent of SQL Server function SCOPE_IDENTITY() in MySQL?
- What is MySQL ENUM data type? What are the advantages to use ENUM data type?
- What is the C# Equivalent of SQL Server DataTypes?
- Data Replication from SAP PO to SQL Server
- Difference between MySQL and SQL Server
- what are the different attributes of MySQL ENUM data type?
- How can I insert default value in MySQL ENUM data type?
- How can I modify an existing MySQL column’s data type?
- Fix MySQL Error #1064 - You have an error in your SQL syntax… near 'TYPE=MyISAM?
- Add a new value to a column of data type enum in MySQL?
- Does MySQL have an expanded output flag similar PostgreSQL?
- Using SSIS to load data from SQL Server to SAP BW
- How to define an enumerated type (enum) in C++?
Advertisements