sql获取所有数据库名、表名、储存过程以及参数列表(SQL gets all database names, table names, stored procedures, and parameter lists).doc
- 1、本文档共11页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
sql获取所有数据库名、表名、储存过程以及参数列表(SQL gets all database names, table names, stored procedures, and parameter lists)
sql获取所有数据库名、表名、储存过程以及参数列表(SQL gets all database names, table names, stored procedures, and parameter lists)
SQL gets all database names, table names, stored procedures, and parameter lists
1. get all user names:
SELECT, name, FROM, Sysusers, where, status=2, and, islogin=1
Islogin=1stands for accounts
Islogin=0stands for roles
Status=2represents a user account
Status=0said the system account
2. get all database names:
SELECT, Name, FROM, Master..SysDatabases, ORDER, BY, Name
3. get all table names
SELECT, Name, FROM, DatabaseName..SysObjects, Where, XType=U, ORDER, BY, Name
XType=U: represents all user tables;
XType=S: stands for all system tables;
4. get all field names:
SELECT, Name, FROM, SysColumns, WHERE, id=Object_Id (TableName)
5. get all types of databases
Select name from systypes
6. get the primary key field
SELECT, name, FROM, SysColumns, WHERE, id=Object_Id (table name), and, colid= (select, top,, keyno, from, sysindexkeys,, where, id=Object_Id (table name))
[integrated network data processing]
1. get all database names:
(1) Select, Name, FROM, Master..SysDatabases, order, by, Name
2. get all table names:
(1), Select, Name, FROM, SysObjects, Where, XType=U,, orDER, BY, Name
XType=U: represents all user tables;
XType=S: stands for all system tables;
(2) SELECT, name, FROM, sysobjects, WHERE, type =U, AND, sysstat =83
Note: in general, you only need type =U, but sometimes the system tables are mixed (not knowing why), and you can delete these system tables after the next sentence
3. get all field names:
(1) Select, Name, FROM, SysColumns, Where, id=Object_Id (TableName)
(2) SELECT, syscolumns.name, systypes.name, syscolumns.isnullable, syscolumns.length FROM syscolumns, systypes WHERE syscolumns.xusertype = systypes.xusertype AND syscolumns.id = object_id (tableName)
Watch out:
(a) here, in order to highlight some important content, select several of these outputs.
(b) a data type number table containing syscolumns, to get the full name from the systypes
您可能关注的文档
- avrgcc延时库函数的理解(Understanding of avrgcc time delay library function).doc
- a电工品牌营销沟通会企业培训议手记(A electrical brand marketing communication enterprise training meeting notes).doc
- avr单片机开发经验(AVR MCU development experience).doc
- a股市场中金融股的一些特性(Some of the characteristics of a stock market in financial stocks).doc
- b2b商业模式分析(B2B business model analysis).doc
- b2c的现状及发展分析(Present situation and development analysis of B2C).doc
- baby3岁前最需要父母陪伴(Most parents need to be with you before baby3).doc
- basic语言的基本命令(The basic command of the basic language).doc
- baidu地图android创建流程(百度Android创建流程地图).doc
- avr控制矩阵键盘,12864显示简单计算器(AVR control matrix keyboard, 12864 simple calculator).doc
- sql语句select用法详解(SQL statement select usage detailed).doc
- sqlserver2005讲课代码(sqlserver2005讲课代码).doc
- sql转化为excel表格(SQL converted to excel form).doc
- sql面试题(SQL interview questions).doc
- srr酸浸法提取硫酸镍的新工艺流程与实践agn(New technological process and practice of extracting nickel sulfate by SRR acid leaching method Agn).doc
- socket介绍(socket介绍).doc
- star ar-3200+打印起始位置设置(Star ar-3200+ print start position setting).doc
- step by step减肥法(一步一步减肥法).doc
- sqlserver数据库操作语句-基础部分(SQLSERVER database manipulation statement - basic part).doc
- stm8读sht21(STM8读SHT21).doc
文档评论(0)