SqlServer 2008 数据库练习----各种琐碎
发布时间:2020-12-12 12:44:19 所属栏目:MsSql教程 来源:网络整理
导读:增加:insert into '表名' ('列名1','列名2','列名3','列名4'...) values (A,B,C,D....) 创建数据库表的基本语法 1、设置一个自增列 alter table '表名'add '列名' int Identity('开始值','自增长度') not null 2、查询表结构 (1)sp_help '表名' (2)sele
增加: insert into '表名' ('列名1','列名2','列名3','列名4'...) values (A,B,C,D....) 创建数据库表的基本语法 1、设置一个自增列 alter table '表名'add '列名' int Identity('开始值','自增长度') not null 2、查询表结构 (1)sp_help '表名' (2)select * from information_schema.columns where table_name='表名' 3、修改列名 exec sp_rename '表名.旧列名','新列名','column' 4、数据库的增删改查操作 增加 insert into '表名' ('列名1','列名4'...) values(A,D...) 删除 delete '表名' where '列名'='A' 修改 update '表名' set '列名'=A where '列名'=B 查询 select * from '表名' where '条件' (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |