Mssqlserver命令行

 1.查询可用数据库,排除系统库

select * from sysdatabases where dbid>4

2.查询可用表,排除系统表

select * from sysobjects where xtype='u'

3.删除/建立数据库

drop/create database students;

4.删除/新建表

drop table tablename;

create table tb (id int,name varchar(20),sex varchar(20))

5.插入记录

insert into tb (id,name,sex) values ('1','dd','B')

6.查询记录

select * from tb;

7.添加列

alter table tb add address varchar(50);

8.删除某列

alter table tb drop column address

9.收缩数据库

dbcc shrinkdb

dbcc shrinkfile

posted on 2013-06-28 12:58  awk  阅读(215)  评论(0)    收藏  举报

导航