[The case of Mycat1.6 operating SQL Server]

Permalink:  http://gaojingsong.iteye.com/blog/2345449

Preview article: Mycat link SQLServer2005 TDS pre-login response is incomplete 

The solution is as follows: use navcat to connect to the SQLServer database, and treat the SQLServer database as a Mysql database. Because the Mycat backend is a Mysql database, the bottom layer of the database is shielded from the outside, and you don't know what database the backend uses.

 

 

1. Configure the Schema file as follows:


 2. The table is created successfully, but the IDENTITY primary key syntax of SQL Server does not support

3. Failed to insert record, insert column is not specified

4. Insert record OK

5. Query result verification

 

The sample code is as follows:

EXPLAIN select * from dept

 

CREATE TABLE dept(

uuid int NOT NULL,

id int IDENTITY(1,1) NOT NULL,

address varchar(20) 

 

CREATE TABLE `dept` (

  `uuid` int(11) NOT NULL AUTO_INCREMENT,

  `id` int(11) DEFAULT NULL,

  `address` varchar(20) DEFAULT NULL,

  PRIMARY KEY (`uuid`),

  KEY `index_name` (`id`),

  KEY `index_address` (`address`)

 

 

drop table  dept;

CREATE TABLE dept(

uuid int NOT NULL ,

id int  NOT NULL PRIMARY key,

address varchar(20) 

 

INSERT into dept(uuid,id,address) values(1,1,'北京');

INSERT into dept(uuid,id,address) values(2,2,'上海');

INSERT into dept(uuid,id,address) values(3,3,'深圳');

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326483762&siteId=291194637