上善若水
In general the OO style is to use a lot of little objects with a lot of little methods that give us a lot of plug points for overriding and variation. To do is to be -Nietzsche, To bei is to do -Kant, Do be do be do -Sinatra
posts - 146,comments - 147,trackbacks - 0
表数据备份到另一张表:
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}
posted on 2011-11-04 14:20 DLevin 阅读(1430) 评论(0)  编辑  收藏 所属分类: Linux

只有注册用户登录后才能发表评论。


网站导航: