创建表时char值列表的适当变量类型 [英] Appropriate variable type for list of char values while creating table

查看:144
本文介绍了创建表时char值列表的适当变量类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我正在将MySQL数据库转换为SQL服务器数据库。

Hi I am converting MySQL database to SQL server database.

我需要在创建表时使用带有预设文本值的变量。

I need to use a variable with pre-set text values while creating a table.

在MySQL中,以下工作完美:

In MySQL the following works perfectly:

创建表  XYZ(ID varchar(4),TITLE SET('ENGR I','ENGR II','ENGR 3'));

CREATE TABLE XYZ (ID varchar(4), TITLE SET ('ENGR I', 'ENGR II', 'ENGR 3'));

但是在SQL Server中,它不会将SET标识为变量类型。

But in SQL server it does not identify the SET as a variable type.

任何想法?

推荐答案

您会发现每个系统使用的sql方言之间存在许多差异。你不能在tsql中这样做 - 你需要编写单独的语句来创建表,然后用一组特定的行填充它。
You will find many differences between the sql dialects used by each system. You can't do this in tsql - you will need to write separate statements to create the table and then to populate it with a specific set of rows.


这篇关于创建表时char值列表的适当变量类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆