如何获取列表中的数据库对象? [英] How to get database objects in lists?

查看:93
本文介绍了如何获取列表中的数据库对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我必须获取所有数据库对象
即两个列表对象中的表及其列

第一个包含所有表名称及其属性的列表
第二个包含TableId的列表及其具有属性的列列表.

有人可以帮我吗?

Hi all,

I have to get all database objects
i.e Tables and their columns in two List objects

The first list containing all the Table names with its attributes
The second list containing TableId and its columns list with attributes.

Can anyone help me??

推荐答案

您需要检查以下SQL Server中的两个表

1. Sysobjects-这是一个系统表. SQL Server将所有表的条目存储在此表中.
2. Syscolumns-这也是一个系统表.它存储表的列名,存储过程的参数.


您需要在这两个系统表中编写查询,然后获得一个数据表/读取器对象.您需要从数据表/读取器对象中构建一个列表对象.

希望能帮助到你. :)
You need to check folowing two tables in SQL server

1. Sysobjects - This is a system table. SQL Server stores an entry for all table, stored procedure in this table.
2. Syscolumns - This is also a system table. This stores column names of a table, parameters of stored procedure.


You need to write query in these two system table then you get a datatable/reader object. From datatable/reader object you need to build a List object.

Hope it helps. :)


这篇关于如何获取列表中的数据库对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆