电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

SQL语句STARTWITHVIP免费

SQL语句STARTWITH_第1页
1/9
SQL语句STARTWITH_第2页
2/9
SQL语句STARTWITH_第3页
3/9
创建数据库 创建之前判断该数据库是否存在 if exists (select * from sysdatabases where name=databasename) drop database databasename go create database database-name 删除数据库 drop database dbname 备份sql server --- 创建备份数据的 device use master exec sp_addumpdevice disk, testback, c:\mssql7backup\mynwind_1.dat --- 开始备份 backup database pubs to testback 创建新表 create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],..) 根据已有的表创建新表: a:go use 原数据库名 go select * into 目的数据库名.dbo.目的表名 from 原表名(使用旧表创建新表) b:create table tab_new as select col1,col2? from tab_old definition only 创建序列 create sequence simon_sequence minvalue 1 -- 最小值 maxvalue 999999999999999999999999999 -- 最大值 start with 1 -- 开始值 increment by 1 -- 每次加几 cache 20; 删除新表 drop table tabname 增加一个列 alter table tabname add colname coltype 删除一个列 alter table tabname drop column colname 添加主键 alter table tabname add primary key(col) 说明:删除主键:alter table tabname drop primary key(col) 创建索引 create [unique] index idxname on tabname(col?。) 删除索引:drop index idxname on tabname 注:索引是不可更改的,想更改必须删除重新建。 创建视图 create view viewname as select statement 删除视图:drop view viewname 简单基本的sql 语句 (1) 数据记录筛选: sql=select * from 数据表 where 字段名=字段值 order by 字段名 [desc] sql=select * from 数据表 where 字段名 like %字段值% order by 字段名 [desc] sql=select top 10 * from 数据表 where 字段名 order by 字段名 [desc] sql=select * from 数据表 where 字段名 in (值1,值2,值3) sql=select * from 数据表 where 字段名 between 值1 and 值2 (2) 更新数据记录: sql=update 数据表 set 字段名=字段值 where 条件表达式 sql=update 数据表 set 字段1=值1,字段2=值2 ?? 字段n=值n where 条件表达...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

SQL语句STARTWITH

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部