SP With List Of Tables And Dependency Depth...

Jul 24, 2006

I'm having a brain freeze.

I seem to recall that there is a system stored procedure that lists table objects and the "depth" of their dependencies. Something like:


table name 3
table 2 name 3
table 3 name 2
table 4 name 1
table 5 name 0


The results show the name of the table object and the numerical depth of dependencies (ie, if the table had no foreign keys, the depth would be 0).

Does this ring a bell with anyone? I've googled, but my google-shui is weak today.

Regards,

hmscott

View 4 Replies


ADVERTISEMENT

Help Pls? Out Of My Depth...

Mar 22, 2007

Hi there, I'm new here and quite green when it comes to SQL in general - I havent used it in any depth for some years and, in the absence of our DBA I've been asked to produce a report... I'm just using query analyser to extract some data as I don't have access to Crystal or anything similar...

I have a table laid out as follows - the PK is REC_ID. It basically stores all the contract start dates for each client we deal with.

RECID------Company-----Product-----------Date

445as------ABCLtd------ICT-Hardware------2007-01-14 00:00:00.000
253s1------ABCLtd------SOFT-Mainstream---2007-01-18 00:00:00.000
567o8------ABCLtd------SOFT-Maintenance--2007-01-18 00:00:00.000
809b9------Gen4Ltd-----ICT-Hardware------2007-01-14 00:00:00.000
098xc------Gen4Ltd-----SOFT-Maintenance--2007-01-18 00:00:00.000
551df------SteetsPLC---ICT-Hardware------2007-01-14 00:00:00.000
919sd------SteetsPLC---SOFT-Upgrade------2007-01-18 00:00:00.000
010qr------SteetsPLC---SOFT-Maintenance--2007-01-18 00:00:00.000
124vv------SteetsPLC---PERS-Allocations--2007-01-18 00:00:00.000

I can easily extract, for example, how many companies have taken up individual services, or many times individual services have been employed... what I'm having difficulty with is trying to extract, for example, all those companies who have had say taken up ICT AND SOFT services, whether explicit or using a LIKE statement.

For instance, if I wanted to find all those companies that had taken up both 'ICT-Hardware' AND 'Soft-Maintenance' and literally just get back the results...

Company

ABCLtd
SteetsPLC

Or a numeric result(in this case 2) would be ok...


How would I do that?

Sorry, this may seem to be very obvious to you but I'm at a loss...

Hope you can help.

View 7 Replies View Related

3D Depth/Perspective In Bar Charts

Dec 19, 2007



Hello,

My 3D bar charts don't look as good as they could because the bars are too thick when displayed in 3D (depth-wise). If I have many bars, the bars are very thin on the front, and then go back far too much. Has anyone played with the settings to see how to optimize this? Even with 5% rotations, it is still too thick for my taste and doesn't look like the previews in the designer.

Mike

View 3 Replies View Related

Transact SQL :: Retrieve Descendants With Depth Level

Nov 22, 2015

I have a table of Affiliates, each Affiliate can have a ParentId, which refers to another Affiliate. How can I retrieve all children of a given Affiliate, along with their depth level? I have this query which selects the total number of descendants of a given Affiliate, but I need to select all the children + their depth level, up to a certain level.

WITH Descendants AS(
  SELECT RootId = Id, Id
  FROM Affiliates
UNION ALL
  SELECT RootId, Af.Id
  FROM Descendants

[Code] .........

What I want to achieve is a statement that has 3 parameters: RefererId, StartLevel, and EndLevel.

I need a statement that selects all the specified Affiliate.ReferrerId's descendants including their level distance from the referrer, filtered by the StartLevel and EndLevel (WHERE CurrentLevel >= StartLevel AND CurrentLevel <= EndLevel ).

View 2 Replies View Related

Since Installing SSRS I Am Getting Invalid Attempt To Depth When Reader Is Closed

Dec 13, 2007

Since installing Reporting Services on my machine, I have been getting an error whenever I try to execute a reader.read line.

When I ran the same exact code on another machine using someone else's credentials who did not have Reporting Services it ran fine. When I tried to run it on someone else's machine who did not have Reporting Services using my own credentials, I got the same error. Also, when the person who's pc and credentials worked fine on his machine ran the same code back on my machine using his own credentials, he got the same error. When another person who also had Reporting Services tried to run it on his own pc, he got the error as well.



When the reader is first executed (MyDataReader = sSql.ExecuteReader) these were the property values:
depth = 0
fieldcount = 5
hasrows = true
isclosed = false
Item = In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.
recordsaffected = -1 (even though there are records)
VisibleFieldCount = 5

When the reader is loaded into a table (MyTable.Load(MyDataReader)) then the property values changed to:

Depth = {"Invalid attempt to Depth when reader is closed."}
FieldCount = {"Invalid attempt to Depth when reader is closed."}
HasRows = {"Invalid attempt to Depth when reader is closed."}
IsClosed= True
Item = In order to evaluate an indexed property, the property must be qualified and the arguments must be explicitly supplied by the user.
RecordsAffect = -1
VisibleFieldCount = {"Invalid attempt to Depth when reader is closed."}

And when I execute the the following code:

dtReader = MyTable.CreateDataReader()

While (dtReader.Read())
I get this error:
"DataTableReader is Invalid for Current DataTable"


Since the code works with someone else's credentials on a machine that does not have SSRS, and the same problem happens for me regardless of what machine I am on as long as I am using my own credentials what could be causing my problem?





View 1 Replies View Related

Has Anyone Gotten A Tree View With Unknown Depth To Display With Collapse/expand At Every Level?

Dec 6, 2007

has anyone out there found a way to get the best of both recursive hierarchy and drill down in the same report, ie without needing to know how many levels there are in your hierarchy, still being able to report them like a tree view with collapse and expand capability at each level?

View 3 Replies View Related

How Do I Get A List Of Tables In T-SQL

Mar 11, 2005

Hi,
Is there anything equivalent to Oracle's Select * from tab in MS SQL.

View 2 Replies View Related

How I Can Get List Of Tables?

Dec 24, 2005

Hi friends,
How I can get list of tables and list of fields within those tables in SQL server.
Thnak a lot.
 

View 4 Replies View Related

List Of Tables

Jun 6, 2001

How to obtain the list of the tables of a base by un script

View 1 Replies View Related

How To Get A List Of Tables Currently In A DB

Mar 21, 2001

Hi all,

Does any one know what command(s) I can use from a SQL prompt to tell me what tables are cruuently residing in a particular database. I'm looking for something along the lines of "select list_of_all_tables from tempdb", which can be applied to any valid db on the system.

Thanks in advance for any guidance.

Rgds,
Kevin

View 3 Replies View Related

List From Three Tables

Oct 5, 2006

HI I have three tables as here:

inventory
isbn, status, status_date, quantity

authors
id, first_name, family_name

books
isbn, category, title, num_pages, price, copyright, author1, author2, author3


How can I list title and author name of the book that is most in stock?

My another problem to

Listing names of authors who have not written ay books

Thanks folks!!!

View 4 Replies View Related

List All Tables Ans SP

May 25, 2008

Hi

can I through a script retrieve a list af all tables and stored procedure in a database?

View 6 Replies View Related

List Tables Which Are Used By A SP

Sep 17, 2007

Hi,
I got a request from a devloper asking, how can he find out what tables his stored procedure his using, so he can remove unwanted SP which are using old tables in the database.

Bharath JrDBA

View 3 Replies View Related

List Of Tables In A Db

Jul 20, 2005

Hi Allcan some one please tell me the transact sql code that can list all tablesin a db.thanksTodd

View 1 Replies View Related

Retrieving A List Ot Tables

Mar 7, 2007

Hello Everyone and thanks for your help in advance.  I am working on an application that connects to SQL Server.  I need to find out if there is any way (I know there is, not sure how) to retrieve a list of tables within a database and also, a way to retrieve a list of databases within a server.  I am using VB.Net in a web application.  Any help on this owuld be greatly appreciated.

View 2 Replies View Related

How To Get List Of Tables In A Database

Jan 22, 2004

Hello

How I get the list of tables in a database. I'm using sql server 2000.

Thanks

View 3 Replies View Related

List User Tables

Apr 14, 2001

I'm brain-dead today, sadly. If it weren't for IE remembering previous entries, I don't know if my name and email would have made it into the header correct :-)

I want the SQL command that lists the names of all user tables.

Alternatively, I have the following problematic Access 2000 code:

Public Sub ListAllTables()
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table
Dim cnn As New ADODB.Connection
Dim i As Integer, j As Integer
Dim vgRet As Variant
Dim intPrefixLen As Integer
Dim strAppend As String

DoCmd.Hourglass True
cnn.Open CurrentProject.Connection
cat.ActiveConnection = CurrentProject.Connection
intPrefixLen = Len(CON_pkgPrefix)

Debug.Print cat.Tables.Count

For j = (cat.Tables.Count - 1) To 0 Step -1
Set tbl = cat.Tables(j)
With tbl
Debug.Print tbl.Name
vgRet = SysCmd(acSysCmdSetStatus, tbl.Name)
End With
Next

Set tbl = Nothing
Set cnn = Nothing
Set cat = Nothing
DoCmd.Hourglass False
vgRet = SysCmd(acSysCmdSetStatus, " ")
End Sub

This code runs fine against an MDB but against SQL it includes all the views, rather than just the tables. If you have a fix for this, that will do just fine!

Arthur

View 1 Replies View Related

List Of All Tables And Size

Oct 1, 2001

Does anybody know how to make a query that presents ALL
tables and their sizes (in Kb or Mb) from a database?

Is there a Stored Procedure for this purpose?

Thanks

View 2 Replies View Related

Cannot List Tables Or Other Objects

Nov 16, 2004

Sometimes, when a try to list tables or view (or access Management, etc) Enterprise Manager hungs up.
Using SELECT * FROM SYSOBECTS also freezes the process. But the SQLServer is operational for data updates and retrieves.

Anyone?

thanx!

View 2 Replies View Related

List Tables In A View??

Jan 5, 2005

Is there a way to easily list the tables/views that a view is using to get its data?

Thanks in advance,
Shawn

View 1 Replies View Related

How Can I List The Tables If I Have SA Access?

Apr 3, 2008

Hi,

I'm very new in SQL Server. Please help me to combine the connection string to the server.
62.33.197.7
login: sa
pwd: S#15trLdatabase
What would be the connection string then? And can I get the tables names if I have the connection string?

View 5 Replies View Related

Get Value From Columns Using List Of Tables

Feb 5, 2014

how do I get value from column using list of tables?

For example, I have list:

schema_name, table_name, column_name

How do I get:

schema_name, table_name, column_name, column_value

View 7 Replies View Related

How To Get Distinct List From Two Tables

Feb 28, 2014

// C - Categories, P - Parameters, CP_Link - linkage table between C and P

// Basically, it is a list of features belonging to a particular category.

DROP TABLE [C];
CREATE TABLE [C] (
ID_CAutoinc,
Name varchar(32),
PRIMARY KEY( ID_C )

[code]....

OK, this works fine, but I want to get a list of parameters (from P table) which holds only those items that linked to all categories requested. In other words, I want only 'leg' and 'hand', but not the 'beard', because 'girls' not linked to 'beard'.Only common features for all of categories listed "IN (,,,)" wanted.

View 3 Replies View Related

List All Tables In Master

Jan 23, 2007

Hi,I need to list all the tables in northwind database.I'm using sql server 2000.In query analyser i'm in master database.I don't want to change the database to northwind.How to list all the tables in northwind database when the databasecombobox has master in query analyser.I want to run this query with database name.I won't want to run forcurrent database.Kindly help me to solve the problem.Thanks & Regards,Mani

View 1 Replies View Related

How Do I List Columns Within Tables?

Mar 4, 2008

Hi All.
I'm an Oracle DBA who's currently being asked to look at a SqlServer Database. I need a list of columns per table, but am having trouble.
I'll admit I might be being lazy here, but I'm in a hurry and using the valueable resources available to me!! Would really appreciate the sql i need to copy into the query window. Much obliged!!
I need........
Table A
Column1 Datatype
Column2 Datatype
Table B
Column1 Datatype
Column2 Datatype
etc....
Many thanks.

View 7 Replies View Related

How To List All The Tables In AdventureWorks With T-SQL

May 29, 2008



I guess it's possible to do that, because in SQL Server Management Studio, all things(such as Tables,Triggers, Indexes, Constraints, Keys) are displayed in the TreeView.

But I am quite don't understand how to do that with T-SQL.

thanks

View 4 Replies View Related

List Of System Tables

Mar 31, 2008

In which folder under the system tables (syscolumn, sysobjects, etc.) of a database are listed?

View 4 Replies View Related

How To Get The List Of Tables In A Database?

May 29, 2008

Is there a query to get the list of tables in a database in sqlserver2000 and 2005?

View 1 Replies View Related

List Tables In A Database

Jan 2, 2008

Hello,

I'm just wondering if anyone here knows how I can get a list of tables in reference to my database, Customers.mdf. This is SQL Server 2005 database.

I have tried using:
SELECT name FROM sys.sysobjects WHERE (xtype = 'U')


and, is listing system objects such as sysdiagrams. I would like to get tables in Customers.mdf only. Thanks

View 4 Replies View Related

List Of Tables Without Clustered Index.

Jan 24, 2002

Hello!!

Can any one help me out how to find the list of tables those do not have the cluster indexes on it.

TIA,
Paul

View 1 Replies View Related

How To Return A List Of Empty Tables

Mar 19, 2003

I want to return a list of user tables from a database where the rowcount is 0. This will be a 3 step process: (1) truncate all 'New%' tables, (2) load data via ODBC/DTS into 'New%' tables, (3) list all 'New%' tables with zero rows (i.e. those that didn't get loaded, as all tables in the ODBC data source contain data).

I've tried:
select left(s2.name,32) as TableName, max(s1.rows) as Records
from sysindexes s1
inner join sysobjects s2 on s1.id=s2.id
where type = 'U' and s2.name like 'New%'
group by s2.name
HAVING max(rows) = 0
ORDER BY TableName
but of course there are multiple rows in sysindexes and the routine does not reliably return the correct list; for example the data in sysobjects & sysindexes, without the max and group by, might look like:
TableNameRows
NewARTxn0
NewARTxn1214800
NewARTxn1214800
NewARTxn1214800
NewARTxn1214800
NewARTxn1214800
NewARTxn1214800
I was hoping to come up with a single T-SQL statement that I could use in an xp_sendmail situation to email me the results.

Thanks for the suggestions.

Al

View 3 Replies View Related

How To List Tables,indexes,views Etc...

Jun 16, 2003

Hi,

I want to list the table names in a database "mydev_db".What would be the query ?.

I want to run a similar query to find out the indexes,views,stored_procs etc.



Regards,
Copernicus

View 3 Replies View Related

How To List Tables,number_rows And Size_in_bytes

Sep 26, 2003

Hi,

I have about 500 tables in my db.I want to list out all the tables in this format

table_name num_rows bytes
---------- ------ -----
a 100 1024
b 200 2048


Thanks,
Sal

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved