Find no of tables in particular database

Hello friends,
I want to know no. of tables in particur database .
I am using sql server .
There is any method in jdbc to know no. of tables in database.
please give solution .
thanks in advance
nitin Jain

DatabaseMetaData can help with that. Go have a look at the javadocs. You can get a ResultSet with all tables and then iterate through that.
%

Similar Messages

  • Query to find the biggest table in the database..!!!

    Hello everybody,
    i have more than 600 tables in the database i need to find the biggest table in the database and want to order it in descending pattern..
    Is there any query for this task...
    Rgds
    Harsh.

    What version of Oracle? Do you use the CBO or the RBO? If you use the CBO, are your statistics accurate? Can you tolerate having approximate rowcounts?
    SELECT table_name, num_rows
      FROM user_tables
    ORDER BY num_rowsmay be what you're looking for, but
    - num_rows is populated when you gather statistics, so it'll be empty if you're using the RBO
    - num_rows may be an approximate number, depending on how you're gathering statistics
    - num_rows only reflects the size at the instant you gathered statistics. It is not maintained in real time.
    I'm guessing, though, that this is close enough for whatever you're doing.
    Justin

  • Cannot find Site Inventory table in Logging database in SharePoint 2013

    I'm trying to build an Analysis Services cube based on the wss_logging SharePoint 2013 database, like I did some times ago in SharePoint 2010.
    I'm extracting Site Sizes for example from the sitesize table. My problem is that all sites are referenced by their Id, and I can't find any table in the WSS_Logging database that convert Id's into Url (or anything readable). In SharePoint 2010, there was
    a table named SiteInventory that did the job, but it seems that the timerjob related to this table no longer exists in SharePoint 2013 (the job name was Site Collection Usage if I remember right).
    Any idea where I can (easily) find the correspondance Id - Site Name in SQL Server Logging database ? Or somewhere else (but remember I must use it in Analysis Services) ?
    Regards.

    Hi Bolebo,
    Thank you for your question.
    We are currently looking into this issue and will give you an update as soon as possible.
    Thank you for your understanding and support.
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • Finding the base tables of a database view

    Hi
    I have a database view like VIQMEL, VIQMSM .So how can i find the what are the base tables for these views.
    pls let me know
    kumar

    Hi ,
    In SE11,
    1. Type in VIQMSM.
    2. Display
    3. you have a tabe "Table & Join Condition.... to list all the releated tables for this view...
    If the hint is useful… Say thanks by reward….
    Regards,
    Prabhu Rajesh

  • Find the objects in a particular database.

    Dear All
    I want to find all the objects belogs to a particular tablespace. Please send me a way how I can do tht. (data dictionary name)
    Thanks and Regards
    Buddhike

    Hello,
    If you have objects from various schemas in the same Tablespace you may use the following query:
    select owner, segment_name, segment_type
    from dba_segments
    where tablespace_name = '<TABLESPACE_NAME>'
    order by owner, segment_name;This query will give you also the TYPE of the Segment (TABLE, INDEX, CLUSTER, ...).
    Hope this help.
    Best regards,
    Jean-Valentin

  • To find out empty tables in a database

    Hi all,
            I have a database which gets its daily feed from a ftp file. Now is there any way i can figure out the empty tables in the databese which doesnot get any data on the feed.
    Thanks in advance,

    That's a cool little function.
    In case it ever DOES go away in future versions of SQL Server, this will do the same thing:
    --Here is the command template:  
    declare @cmdtemplate nvarchar(500)  
    set @cmdtemplate='if exists(select * from ?) print ''Table ? is not empty.''' 
    --Set up the batch of commands, one for each table, substituting ? for the table name:  
    declare @cmdbatch nvarchar(max)  
    select @cmdbatch=coalesce(@cmdbatch+'; ','')+replace(@cmdtemplate,'?',TableName)  
    from (select quotename(Table_Schema)+'.'+quotename(Table_Name) as TableName  
          from INFORMATION_SCHEMA.TABLES  
          where Table_Type='BASE TABLE') as q  
    --Execute that batch of commands:  
    exec sp_executesql @cmdbatch  
    --Brad

  • Finding all tables of a database

    hi,
    i want to find out all table of a database .
    how could i.
    thnx

    try this
    DatabaseMetaData dbmd=con.getMetaData();
    ResultSet rsTable=dbmd.getTables(null,null,"%",null);
    while (rsTable.next())
    //String tableCatalog = rsTable.getString(1);
    //String tableSchema = rsTable.getString(2);
    System.out.println("Table Name - "+rsTable.getString(3)+" - catalog  - "+rsTable.getString(1)+" - schema - "+rsTable.getString(2)+" - Type - "+rsTable.getString(4));
    rsTable.close();

  • Find particular database role permission on all the databases of an instance

    Hi Team,
    I want to find particular database role permission on all the databases of a instance.
    Example: 50 databases are running on an instance. I want to find datareader permission of ABCDE account, on which of the databases it exist?
    Please provide me a customized script to find it.
    Thanks
    Kumar

    Hi K735,
    According to your description, you want to find databases where a specific database role of a specific user exists. To do this, you could execute the stored procedure below by proving a value for each of the two parameters (@databaseRole, @user)  to
    specify the database role and the user as the following example: execute findDatabaseRole 'db_datareader', 'testUser'
    USE master
    GO
    CREATE PROCEDURE dbo.findDatabaseRole
    @databaseRole VARCHAR(200),
    @user VARCHAR(250)
    AS
    DECLARE @DBuser_sql VARCHAR(4000)
    DECLARE @DBuser_table TABLE
    AssociatedDatabaseRole VARCHAR(200),
    DBName VARCHAR(200),
    UserName VARCHAR(250),
    LoginType VARCHAR(500)
    INSERT @DBuser_table
    EXEC sp_MSforeachdb @command1='SELECT USER_NAME(b.role_principal_id) AS AssociatedDatabaseRole, "[?]" AS DBName, a.name AS Name,
    a.type_desc AS LoginType FROM [?].sys.database_principals a
    , [?].sys.database_role_members b where a.principal_id=b.member_principal_id and
    a.sid NOT IN (0x01,0x00) AND a.sid IS NOT NULL AND a.type NOT IN ("C")
    AND a.is_fixed_role <> 1 AND a.name NOT LIKE "##%" AND "?" NOT IN ("master","msdb","model","tempdb")
    ORDER BY Name'
    SELECT AssociatedDatabaseRole, DBName,UserName,LoginType
    FROM @DBuser_table WHERE UserName=@user and AssociatedDatabaseRole=@databaseRole
    group by AssociatedDatabaseRole, DBName,UserName,LoginType
    GO
    Regards,
    Michelle Li

  • How do i find out the tables (data)effected in a schema after a particular time stamp

    how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
    pls email in [email protected]

    You can't do that. That would be a real security risc.
    /KAj

  • How do i find out the tables effected in a schema after a particular time stamp

    how do i find out the tables effected in a schema after a particular time stamp?
    pls email in [email protected]

    If you are doing a reload every time then you can issue following commands to clear data from cube.
    lmt name to all
    allstat
    clear all from <cubename>prttopvar
    You can wrap above commands in pl sql procedure using dbms_aw.execute package and execute it before cube load starts. Instead of clearing it from whole cube you can clear only from one partition also. Just take a look at clear command in olap DML 10.2 reference.
    Thanks,
    Brijesh
    Edited by: Brijesh Gaur on Aug 10, 2010 6:47 AM

  • How to search this value in oracle database to find out the table

    Hi expert,
    I know there is a value in oracle database, please show me how to search this value in oracle database to find out the table holding this value.
    Many Thanks,

    918440 wrote:
    Hi friends,
    this question is really practical, I already know there is value from application saved in database, I want to search the whole database to figure out which table the value is contained.write SQL that writes SQL to query every table.
    Handle:     918440
    Status Level:     Newbie
    Registered:     Mar 2, 2012
    Total Posts:     20
    Total Questions:     10 (10 unresolved)
    why do you waste time here when you NEVER get any answer to any question you post?

  • How to find all the tables associated for a particular transaction

    Hi-
    May I know how to find all the tables, related(foreign key) tables for a transaction within SAP GUI?
    Up to my technical knowledge, this can be achieved by looking database diagrams from DB level. But that would be for entire database as a whole. What I'm expecting is to see transaction level relative tables that too from SAP GUI. Please share the possibilities if any.
    Regards
    Sekhar

    Dear Micky Oestreich
    May be we possess expertise or high level experience, it should not show up in our way of communication. Every professional starts with the basic stuff to learn. When the question is raised in such minimum polite way, the same level of courtesy is expected in return. If you felt my question was basic, you might have refused it gently. If you are in good mood or bad mood it doesn't matters.
    Hi Vengal Rao
    Thanks for your response. It helped me.
    Regards
    Sekhar

  • Finding same column name from multiple database tables

    I am needing to find all tables in a database that contain the same column. ie: which tables in database A have col_a in it.
    Is it possible to do a sql code to qry all of this?
    Thanks

    No, Ignacio did not, at least, not really. ;)
    The usage of ALL_TAB_COLUMNS only has info for tables which the actual user has access to.
    If you need to be sure that you search each and every table, you have to use DBA_TAB_COLUMNS (or the connected user must be a super hero...).
    Just wanted to point that out.
    Regards,
    Guido

  • How can I find the schemas used in a database?  Any system table contains?

    How can I find the schemas used in a database? 
    Any system table contains?
    I would like to know sql statement (dictionary object name) which tells the all schema s in a database like dba_users.

    Hello,
    this SQL should help:
    db2 "select schemaname from syscat.schemata"

  • How can i find statistics tables in my database?

    code{
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.
    the above is one of the post upgrade step for 11gR2. How can i find statistics tables in my database?

    You need to read the complete context of this manual upgrade step:
    Step 33
    Upgrade Statistics Tables Created by the DBMS_STATS Package
    If you created statistics tables using the DBMS_STATS.CREATE_STAT_TABLE procedure, then upgrade these tables by executing the following procedure:
    EXECUTE DBMS_STATS.UPGRADE_STAT_TABLE('SYS','dictstattab');
    In the example, 'SYS' is the owner of the statistics table and 'dictstattab' is the name of the statistics table. Execute this procedure for each statistics table.You need to do this step for any statistics table that you created manually with DBMS_STATS.CREATE_STAT_TABLE.
    Marcus

Maybe you are looking for

  • Upgrade iMac late 2006

    As requested.   Will repeat description of my problem and add one other annoying intrusion.  The Whirling Ball has started to appear (have been working on a newsletter in Pages)  Solution so far is to quit Pages and reopen, not very elegant. My Mac i

  • PDF Printing issue (passing static items)

    Hello experts, I am starting out with PDF printing from Apex and have a small (I hope) issue. I have downloaded a demo from Oracle site and all works OK. To test the ability to create my own RTF templates I have added an additional item on the page c

  • Acrobat pro 9 won't open pdf files

    Just downloaded trial version of pro 9 for Mac.  I tried to install pro 8 and found out that it is not compatible with snow leopard.  The uninstall in version 8 is also not compatible with snow leopard.  So I had all kinds of trouble uninstalling ver

  • 2 iCloud Accounts?

    Hi - My husband and I share a mac power book - we both have the iPhone 4S - I have iCloud setup - can he also set it up on the same computer using his apple ID? right now, we have a mess of contacts etc. and want to get them separate

  • MacBook Pro (Retina, 13-inch, Early 2013) Flash Storage Failure

    So I've been getting Kernel panics for the past few weeks on and off. So I ran the Apple Diagnostics and right off the bat told me my hard drive was failing. I'm going in tomorrow to the Genius Bar. I have Apple Care and Time Machine. My question is