zoukankan
html css js c++ java
有用的数据SQL脚本(做数据字典比较有用哦)
select
[
name
]
from
[
sysdatabases
]
order
by
[
name
]
查询一个数据库中的所有表
select
[
id
]
,
[
name
]
from
[
sysobjects
]
where
[
type
]
=
'
u
'
and
status
>
0
都知道
[
type
]
=
'
u
'
是用户表,
[
type
]
=
'
s
'
是系统表吧。
根据上个语句的查询结果然后再
查询一个表中的所有字段(我尝试不用
[
ID
]
,而用
[
name
]
去查,结果报错了)
select
[
name
]
from
[
syscolumns
]
where
[
id
]
=
1931153925
查询表结构
SELECT
table_name,column_name,column_default,
is_nullable,data_type,character_maximum_length
FROM
INFORMATION_SCHEMA.COLUMNS
SELECT
table_name
as
'
表名
'
,column_name
as
'
列名
'
,data_type
as
'
类型
'
,
character_maximum_length
as
'
长度
'
,column_default
as
'
默认值
'
,is_nullable
as
'
是否为空
'
FROM
INFORMATION_SCHEMA.COLUMNS
where
table_name
in
(
select
name
from
sysobjects
where
xtype
=
'
u
'
and
status
>
0
)
order
by
table_name
将孤立的用户名关联
sp_change_users_login
'
report
'
sp_change_users_login
'
update_one
'
,
'
OAS
'
,
'
OAS
'
sp_change_users_login
'
Auto_Fix
'
,
'
test
'
,
NULL
,
'
testpassword
'
查看全文
相关阅读:
Mongodb 的ORM框架 Morphia之注解
Redis主从集群及哨兵模式
Dubbo
Zookeeper
使用Dockerfile自定义一个包含centos,tomcat的镜像
linux/centOS 下安装 ngnix
Session共享
Linux安装jdk.18和tomcat8
MongoDB集群的搭建
多态--方法重写的三个要点
原文地址:https://www.cnblogs.com/ringwang/p/1230916.html
最新文章
postgresql9.5查询sql或者进程是否存在锁
SQL Server常见问题总结
为什么我们用的系统这么烂?
你可能不知道的技术细节:存储过程参数传递的影响
轻松精通数据库管理之道——运维巡检之八(性能)
轻松精通数据库管理之道——运维巡检之六(作业运行情况)
轻松精通数据库管理之道——运维巡检之七(日志)
轻松精通数据库管理之道——运维巡检之四(数据库备份)
轻松精通数据库管理之道——运维巡检之五(实例级参数)
轻松精通数据库管理之道——运维巡检之二(数据库)
热门文章
PHP导出csv文件
mysql主从配置
yii中异步验证和自定义方法验证
yii2.0 模块的使用
yii2.0场景的简单使用
yii2.0 高级版 restful api使用和认证
yii2.0 使用不同语言
yii2.0 URL美化
Python3+flask+nginx+uwsgi
lnmp环境搭建
Copyright © 2011-2022 走看看