如何使用vb 2010在sql中检索用户表名称 [英] How to retrieve user table name in sql using vb 2010
问题描述
我有这样的连接字符串
I have connection string like this
Dim sqlConn As New SqlClient.SqlConnection("Data Source=C8067;Initial Catalog=msdb;Integrated Security=True")
这是一个本地数据库,我在创建它时没有指定任何模式。
现在我只想检索我创建的表名。
我试过这个,但它检索了我不需要的所有表格
This is a local database where i did not specify any schema while creating it.
now i want to retrieve only table names which I created.
I tried this but it retrieves all tables which i do not require like this
Dim cmd As New SqlClient.SqlCommand("select TABLE_NAME from INFORMATION_SCHEMA.TABLES where TABLE_TYPE = 'BASE TABLE'", sqlConn)
结果
syspolicy_policies_internal
sysproxies
sysdbmaintplan_history
backupmediaset
sysdownloadlist
sysjobhistory
backupset
地区
请帮我过滤一下。我想只创建我创建的表
Result
syspolicy_policies_internal
sysproxies
sysdbmaintplan_history
backupmediaset
sysdownloadlist
sysjobhistory
backupset
regions
Please help me filter. I want to only tables I created
推荐答案
SELECT sobjects.name
FROM sysobjects sobjects
WHERE sobjects.xtype = 'U'
这篇关于如何使用vb 2010在sql中检索用户表名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!