表数据备份到另一张表:
select * into destTbl from srcTbl
条件:destTbl表不存在
insert into destTbl(fld1, fld2) select fld1, 5 from srcTbl
条件:destTbl表存在
修改数据库列数据类型:
alter table [table name] modify [column name] varchar(32) null
增加列:
alter table [table name] add [column name] varchar(10) null
删除列:
alter table [table name] drop [column name]
同时修改多列:
update [table name] set [column1]=[value1], [column2]=[value2] where ......
DerbyDB创建自增字段:
CREATE TABLE MAPS ( MAP_ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1), MAP_NAME VARCHAR(24) NOT NULL, REGION VARCHAR(26), AREA DECIMAL(8,4) NOT NULL, PHOTO_FORMAT VARCHAR(26) NOT NULL, PICTURE BLOB(102400), UNIQUE (MAP_ID, MAP_NAME) )
BCP命令:bcp {db_name}.dbo.{tablename} out {filename}.bcp -I{interface_name} -S{db_name_in_interface} -U{user_name} -P{password} -c -t"|" -Y bcp {db_name}.dbo.{tablename} in {filename}.bcp -I{interface_name} -S{db_name_in_interface} -U{user_name} -P{password} -c -t"|" -Y Interface definition: {db_name_in_interface} master tcp ether {db_server_name} {port} query tcp ether {db_server_name} {port}
时间: 2024-09-13 09:18:04