——–存储过程
—-系统存储过程
exec sp_databases —–查找数据库信息
exec sp_tables —–查找表的信息
exec sp_columns
exec sp_helpINDEX mn_user —-查看表mn_user的索引
exec sp_helpconstraint mn_user ——–查看表 mn_user的约束
exec sp_stored_procedures —-查看当前数据库的存储过程列表
exec sp_helptext ‘sp_helptext’ —查看存储过程sp_helptext的定义
exec sp_helpdb
exec sp_defaultdb
exec sp_renamedb
exec sp_rename
—-扩展存储过程
—-xp_cmdshell
use master
go
—exec xp_cmdshell ‘md d:\Back’,NO_OUTPUT
if exists(select * from sysdatabases where name=’DBNote’)
drop database DBNote
go
CREATE DATABASE DBNote
ON PRIMARY
( NAME = ‘DBNote’,
FILENAME = ‘f:\DBNote.mdf’ ,
SIZE = 3072KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 1024KB
)
LOG ON
( NAME = ‘DBNote_log’,
FILENAME = ‘f:\DBNote_log.ldf’ ,
SIZE = 1024KB ,
MAXSIZE =