一.库里有多少个表,表名等 select * from INFORMATION_SCHEMA.TABLES 二.查询表.字段.类型.是否主键.长度.小数位.是否允许空.默认值等详细查询 效果: SELECT ( then d.name else '' end) as 表名,--如果表名相同就返回空 a.colorder as 字段序号, a.name as 字段名, ( then '√'else '' end) as 标识, (case when (SELECT count(*) FROM sy…
SELECT DISTINCT TOP 100 PERCENT isnull(p.name,'') AS 父对象, o.xtype, CASE o.xtype WHEN 'C' THEN 'CHECK 约束' WHEN 'D' THEN '默认值或DEFAULT约束' WHEN 'F' THEN 'FOREIGNKEY约束' WHEN 'L' THEN '日志' WHEN 'FN' THEN '标量函数' WHEN 'IF' THEN '内嵌表函数…
USE 数据库 GO SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO CREATE function 函数名称 (@EmpID nvarchar(50)) returns nvarchar(10) as begin DECLARE @TempDayID NVARCHAR(10), --費用計算日 @TempDayID1 NVARCHAR(10), --最…
use tax_ceshiselect 'DROP TABLE '+name from sysobjects where type = 'U'union select 'DROP VIEW '+name from sysobjects where type = 'V' unionselect 'DROP PROC '+name from sysobjects where type = 'P' unionselect 'drop function '+name from sysobjects wh…