一切福田,不離方寸,從心而覓,感無不通。

sqlite常用操作语句

PRAGMA foreign_keys = 0;

CREATE TABLE sqlitestudio_temp_table AS SELECT *
FROM Websites;

DROP TABLE Websites;

CREATE TABLE Websites (
WebsiteId INTEGER PRIMARY KEY AUTOINCREMENT
NOT NULL,
WebsiteName VARCHAR (255),
WebsiteDirectory VARCHAR (255),
DbType INT DEFAULT (0),
DbName VARCHAR (100),
DbUid VARCHAR (50),
DbPwd VARCHAR (30),
BackupDirectory VARCHAR (255),
BackupDateTime DATETIME,
AddDateTime DATETIME
);

INSERT INTO Websites (
WebsiteId,
WebsiteName,
WebsiteDirectory,
DbType,
DbName,
DbUid,
DbPwd,
BackupDirectory,
BackupDateTime,
AddDateTime
)
SELECT WebsiteId,
WebsiteName,
WebsiteDirectory,
DbType,
DbName,
DbUid,
DbPwd,
BackupDirectory,
BackupDateTime,
AddDateTime
FROM sqlitestudio_temp_table;

DROP TABLE sqlitestudio_temp_table;

PRAGMA foreign_keys = 1;