Showing posts with label views. Show all posts
Showing posts with label views. Show all posts

Monday, March 19, 2012

List user-defined objects

Hi, all. How does one list all the user-defined objects (tables, udf's,
udt's, stored procedures, and views) for a SQL Server 2000 db -- the ones
owned by dbo? Thanks.Check information schema views in BOL.
use yourDB
go
declare @.s sysname
set @.s = N'dbo'
select
table_name,
table_type
from
information_schema.tables
where
(table_type = 'base table' or table_type = 'view')
and table_schema = @.s
and objectproperty(object_id(table_schema + '.' + quotename(table_name)),
'IsMSShipped') = 0
select
*
from
information_schema.column_domain_usage
where
domain_schema = @.s
select
routine_name,
routine_type
from
information_schema.routines
where
(routine_type = 'procedure' or routine_type = 'function')
and routine_schema = @.s
go
AMB
"dw" wrote:

> Hi, all. How does one list all the user-defined objects (tables, udf's,
> udt's, stored procedures, and views) for a SQL Server 2000 db -- the ones
> owned by dbo? Thanks.
>
>|||Thank you, Alejandro. I didn't know what to look under -- now I know to
research information schema views. Thanks :)
"Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in message
news:8AC22FB8-4D41-471E-9762-1E669A1D3BBB@.microsoft.com...
> Check information schema views in BOL.
> use yourDB
> go
> declare @.s sysname
> set @.s = N'dbo'
> select
> table_name,
> table_type
> from
> information_schema.tables
> where
> (table_type = 'base table' or table_type = 'view')
> and table_schema = @.s
> and objectproperty(object_id(table_schema + '.' + quotename(table_name)),
> 'IsMSShipped') = 0
> select
> *
> from
> information_schema.column_domain_usage
> where
> domain_schema = @.s
> select
> routine_name,
> routine_type
> from
> information_schema.routines
> where
> (routine_type = 'procedure' or routine_type = 'function')
> and routine_schema = @.s
> go
>
> AMB
>
> "dw" wrote:
>|||http://www.aspfaq.com/search.asp?q=schema%3A
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.
"dw" <cougarmana_NOSPAM@.uncw.edu> wrote in message
news:em7WicTNFHA.1884@.TK2MSFTNGP15.phx.gbl...
> Thank you, Alejandro. I didn't know what to look under -- now I know to
> research information schema views. Thanks :)
> "Alejandro Mesa" <AlejandroMesa@.discussions.microsoft.com> wrote in
message
> news:8AC22FB8-4D41-471E-9762-1E669A1D3BBB@.microsoft.com...
quotename(table_name)),
ones
>

List Tables in a view?

Is there a way to easily list the tables/views that a view is using to get its data?
Thanks in advance,
Shawnsp_depends <Viewname>

Books online {sp_depends}

Monday, March 12, 2012

List of tables in use by a view

Hi,

I wonder if I can list the tables (and views) used inside a view, I mean the list of tables in the FROM clause

Thanks,

Arty

An easy way is to call the "sp_depends @.objname" stored procedure. Within Management Studio, you can also right-click on an object and choose "View Dependencies"

Peter

|||I would like to do it inside VB.NET or C# using the SMO|||One way is to use SMO like:

Database db = srv.Databases["test"];

string a = "sp_depends " + objname;

db.ExecuteWithResults(a);
There are other ways of using SMO to get the dependency information, but I do not have the code available.

Peter

list of tables and views in a database

Hi
Can someone tell me the best way to extract a list of table names and views
from a database in a select statement? I'm using SQL Server 2000.
Many thanks
Andrewhttp://www.aspfaq.com/search.asp?q=schema%3A&category=1
"J055" <j055@.newsgroups.nospam> wrote in message
news:udiRk7RSGHA.3944@.TK2MSFTNGP10.phx.gbl...
> Hi
> Can someone tell me the best way to extract a list of table names and
> views from a database in a select statement? I'm using SQL Server 2000.
> Many thanks
> Andrew
>|||That's a very useful link.
Thank you
"Aaron Bertrand [SQL Server MVP]" <ten.xoc@.dnartreb.noraa> wrote in message
news:OPVwtCSSGHA.336@.TK2MSFTNGP12.phx.gbl...
> http://www.aspfaq.com/search.asp?q=schema%3A&category=1
>
>
>
> "J055" <j055@.newsgroups.nospam> wrote in message
> news:udiRk7RSGHA.3944@.TK2MSFTNGP10.phx.gbl...
>|||select * from information_schema.tables
"J055" <j055@.newsgroups.nospam> wrote in message
news:udiRk7RSGHA.3944@.TK2MSFTNGP10.phx.gbl...
> Hi
> Can someone tell me the best way to extract a list of table names and
> views from a database in a select statement? I'm using SQL Server 2000.
> Many thanks
> Andrew
>

Friday, March 9, 2012

List of Merge Article

I know transactional replication keep all articles in sysarticle system
table. Is there any other table or views for merge articles.
TIA
Thanks ,
I found the table name sysmergearticles.
"Sandeep Shankar" <sandeeps@.dntg.net> wrote in message
news:%236KR54AxHHA.1484@.TK2MSFTNGP06.phx.gbl...
> I know transactional replication keep all articles in sysarticle system
> table. Is there any other table or views for merge articles.
> TIA
>
|||Also have a look at sp_MShelpmergearticles.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Sandeep Shankar" <sandeeps@.dntg.net> wrote in message
news:%236KR54AxHHA.1484@.TK2MSFTNGP06.phx.gbl...
>I know transactional replication keep all articles in sysarticle system
> table. Is there any other table or views for merge articles.
> TIA
>

Monday, February 20, 2012

List all indexed views in a DB

How can I list all the indexed views in a DB ?http://www.aspfaq.com/2526
Just move the Indexed calculation to the WHERE clause.
A
On 2/27/05 9:15 PM, in article uO$3itTHFHA.1392@.TK2MSFTNGP10.phx.gbl,
"Hassan" <fatima_ja@.hotmail.com> wrote:

> How can I list all the indexed views in a DB ?
>