Home >Database >Mysql Tutorial >sqlserver数据库中的表、字段sql语句

sqlserver数据库中的表、字段sql语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 18:00:571121browse

在数据库中创建的每个对象(例如约束、默认值、日志、规则以及存储过程)都对应一行。

1.系统表sysobjects

在数据库中创建的每个对象(例如约束、默认值、日志、规则以及存储过程)都对应一行。

参考

2.syscolumns

为每个表和视图中的每列返回一行,并为数据库中的存储过程的每个参数返回一行。

参考

删除某数据库内的表

declare dlist cursor for
select name from sysobjects where xtype='U'
open dlist
declare @n varchar(4000)
fetch next from dlist into @n
while @@fetch_status=0
begin
declare @es varchar(4000)
set @es='DROP table
exec( @es)
fetch next from dlist into @n
end
close dlist
DEALLOCATE dlist

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn