日期:2014-05-18  浏览次数:20460 次

MS-SQL2005与mysql有哪些区别?
如果要将一个mysql语句,改成sqlserver,需要改什么?

例如

-- Table structure for kcfiles
-- ----------------------------
DROP TABLE IF EXISTS `kcfiles`;
CREATE TABLE `kcfiles` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `filename` varchar(255) default NULL,
  `filetype` varchar(255) default NULL,
  `fileurl` varchar(255) default NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;

-- ----------------------------
-- Table structure for kechens
-- ----------------------------
DROP TABLE IF EXISTS `kechens`;
CREATE TABLE `kechens` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `kename` varchar(255) default NULL,
  `jianjie` varchar(255) default NULL,
  `gangyao` varchar(255) default NULL,
  `jiaochen` int(20) default NULL,
  `tid` varchar(255) default NULL,
  `rnum` int(20) default NULL,
  `isPass` varchar(10) default NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;

------解决方案--------------------
SQL code

-- Table structure for kcfiles
-- ----------------------------
if object_id('kcfiles') is not null
   drop table kcfiles;
go

create table kcfiles 
(
  id int not null identity(1,1) primary key,
  filename varchar(255) null,
  filetype varchar(255) null,
  fileurl varchar(255) null
);
go
-- ----------------------------
-- Table structure for kechens
-- ----------------------------
if object_id('kechens') is not null
   drop table kechens;
go

create table kechens 
(
  id int not null identity(1,1) primary key,
  kename varchar(255) null,
  jianjie varchar(255) null,
  gangyao varchar(255) null,
  jiaochen int null,
  tid varchar(255) null,
  rnum int null,
  isPass varchar(10) null
);
go