1.数据备份 ) ) ) )),'-','') ) SET @savePath = 'f:/DatabaseBackup/' DECLARE My_Cursor CURSOR FOR ( select name from sys.databases where name not like '%tmp%' and name not like '%temp%' and name not like '%master%' and name not like '%model%' and name not
select s.[name] + '.' + t.[name] as tablename from sys.tables as t,sys.schemas as s where t.schema_id = s.schema_id and s.[name] = @dbo order by tablename 获取指定架构下的所有表 SELECT ( then d.name else '' end) 表名, a.colorder 字段序号, a.name 字段名, ( then '√'else '
SqlServer获取所有数据库,表,表结构 --获取所有数据库 SELECT * FROM Master..SysDatabases ORDER BY Name --获取test数据库下所有表 use test SELECT name FROM SysObjects Where XType='U' ORDER BY Name --获取test数据库下所有表结构信息 use test then d.name else null end) 表名, a.colorder 字段序号,a.name 字段
下面的sql语句可以查看表的信息.其中modify_date和create_date可以根据表的修改时间来查看.如果不需要删除后,就能看到所有表的字段信息 ) PERCENT d.name AS 表名, ISNULL(f.value, '') AS 表说明, a.name AS 字段名, CASE WHEN EXISTS ( FROM sysobjects WHERE xtype = 'PK' AND name IN (SELECT name FROM sysindexes WHERE indi
--第一种方法: 查询dba_tab_columns select COLUMN_NAME,DATA_TYPE,DATA_LENGTH from dba_tab_columns where table_name =upper('表名') order by COLUMN_NAME --这种方法需要有DBA权限 --第二种方法: 查询user_tab_cols select COLUMN_NAME,DATA_TYPE,DATA_LENGTH from user_tab_cols wh