lundi 21 mars 2016

Create table from attached table creating new primary key with rowid

I am using ATTACH DATABASE option to attach two database and copying schema and data using below query CREATE TABLE main.userInfo AS SELECT * FROM NEW.userInfo; userInfo table schema NEW database like below

CREATE TABLE 'userInfo'('iUser2Id' INTEGER PRIMARY KEY NOT NULL, 'vName' VARCHAR NULL, 'vEmail' VARCHAR NULL, 'vPhoneNo' VARCHAR NULL)

but in main database userInfo schema creating like below

CREATE TABLE userInfo(iUser2Id INT, vName TEXT, vEmail TEXT, vPhoneNo TEXT)

how to solve this issue. please check below images SQLite DB.

enter image description here enter image description here

Aucun commentaire:

Enregistrer un commentaire