Find foreign key which are able or not

Same as the topic ~ how can I find all the able/unable foreign key/contraints inside a database ? Using TSQL

Hello,
Please try the scripts provided on the following resources:
http://blog.sqlauthority.com/2009/07/17/sql-server-two-methods-to-retrieve-list-of-primary-keys-and-foreign-keys-of-database/
http://blog.sqlauthority.com/2006/11/01/sql-server-query-to-display-foreign-key-relationships-and-name-of-the-constraint-for-each-table-in-database/
http://blog.sqlauthority.com/2007/09/16/sql-server-2005-list-all-the-constraint-of-database-find-primary-key-and-foreign-key-constraint-in-database/
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com

Similar Messages

  • How can I find the profiles which are not in a role

    Hi all,
    how can I find all profiles which are not used in a role. Its important for a security check.

    Hi Stefan,
    you do one thing use the transaction SUIM
    SUIM>>Profile>>By Roles
    give all the role name and execute you will get roles with profiles
    and extract to excel sheet
    to get only profiles
    suim>>profile>>by profile name or text give * and execute
    and extract in excel sheet no compate profile coloumns get the profiles which does not there in any roles
    hope ds helps
    thanks
    kishore

  • How can we find delivery documents which are not goods issued?

    Hi All,
    How can we find delivery documents which are not goods issued?
    Thanks in advance

    hi,
    please check in VL06O.
    there will be plenty of options on the same.
    you are requested togo for push button FOR GOODS ISSUE from there u will go to VL06G only
    your requrient will be satisfied.
    regards,
    balajia
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:39 PM
    Edited by: balaji timmampalli achari on Nov 11, 2010 12:40 PM

  • Suppliers which are active and not being involved for a long time

    Hi All,
    Is there any way we can find suppliers which are active but not being used for a long time (for a specific duration) . i.e being involved in no open POs or no invoices processed or no payments made.
    Please advice.
    Thanks

    Hi Abhi,
    I have created some queries for the same. COuld you help me if I am going in the rite direction.
    I have created a query to find the suppliers which are not being used in the POs for the past one year by using the below query: But for invoices and payments to be included, I am finding it a bit difficult....need help..............
    --FINAL QUERY                                  
    SELECT vendor_id, vendor_name, creation_date, last_update_date
    FROM po_vendors v
    WHERE v.end_date_active IS NULL
    AND v.enabled_flag = 'Y'
    AND NOT EXISTS (
    SELECT 1
    FROM po_headers_all h
    WHERE h.vendor_id = v.vendor_id
    AND h.creation_date(+) BETWEEN (SYSDATE - 365) AND (SYSDATE))
    ORDER BY vendor_id DESC
    Is it possible to send me the program so that it would be helpful for me to use it.
    email: [email protected]
    Help Greatly appreciated.
    Thanks
    Aman

  • How to find foreign key in pl/sql

    Error starting at line 1 in command:
    DELETE FROM ZKET_SOLE WHERE IID_SOLA = 1
    Error report:
    SQL Error: ORA-02292: integrity constraint (IRCKIS.ZKETSTIP_ZKET_FK) violated - child record found
    02292. 00000 - "integrity constraint (%s.%s) violated - child record found"
    *Cause:    attempted to delete a parent key value that had a foreign
    dependency.
    *Action:   delete dependencies first then parent or disable constraint.
    i need to find foreign key but i do not know how. I know that it must be in dictionary but i can not find it. I do not have access to ER model.
    Thx

    You could use a query similar to this:
    SELECT ucc.constraint_name,ucc.table_name,ucc.column_name
    FROM user_cons_columns ucc
    JOIN user_constraints uc on uc.constraint_name=ucc.constraint_name
    WHERE CONSTRAINT_TYPE='R'You could also use the ALL_CONSTRAINTS / ALL_CONS_COLUMNS views.
    Hope this helps!

  • How to sort on MULTIPLE Keys which are elements of VO's stored in  list

    How to sort on MULTIPLE Keys which are elements of VO's stored in a list.. without disturbing the ordering done by previous sorting...?
    Is there any best soln for the same...
    Thanks..

    How to sort on MULTIPLE Keys which are elements of
    VO's stored in a list.. without disturbing the
    ordering done by previous sorting...?Do you mean you want to do a heirarchical sort? Where the secondary key is only used when the primary keys are equal etc.? That's pretty trivial. If the primary keys are equal, check the secondary key. How do you sort words in alphabetical order? It's the same process.

  • How can I fetch the deliveries which are PGIed but not invoiced.

    Hi
    I want to search for the deliveries for which post goods issue has been done but are not invoiced.
    Kindly guide with you valuable comments.
    Regards,
    Satish.

    Hi,
    Use the T.Code:VF04.
    Goto T.Code:VF04
    Enter the Sold-to-party.
    Select Delivery related tick mark and uncheck all.
    Execute.
    It will give all the deliveries which are PGIed but not invoice.
    Regards,
    Krishna.

  • How to find whether the cookies are enabled or not

    Hi All,
    Please suggest me, while sending the first request only how to find whether the cookies are enabled or not.
    thanks.

    you could use a servlet, write a cookie and then try to read it, if it's read then it's enabled else not.

  • Need to find out wether aggregates are using or not

    Hi ,
    In My BW System Aggregates are build on two cubes say Cube 'X' and Cube 'Y'.
    In Sap Early watch Report , they have suggested to De-activate or remove aggregates which are not used .
    1)I need to find out which aggregates are using and which are not using from a period of time (take one month).
    2)I need to find out which queries are using which aggregates.
    Please let me know how to find the above information.

    Hi Lakshmi,
       Welcome to SDN.
    Please go through these links.
    You can find out efficient/inefficient aggregates from BW statistics.
    Performance Tuning for Queries with Aggregates
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cbd2d390-0201-0010-8eab-a8a9269a23c2
    http://www.asug.com/client_files/Calendar/Upload/ASUG%205-mar-2004%20BW%20Performance%20PDF.pdf#search=%22BW%20statistics%20pdf%22
    Business Intelligence Performance Tuning [original link is broken]
    Hope it Helps
    Srini

  • How to find the tables which are the candidates for gathering stats in 10g

    Hi,
    In 10g how can we find the tables, partitions which are the candidates for gathering the stats.
    I want to findo those tables, partitions and gather the stats on daily basis.
    Thanks,
    Mahi

    The probem you describe has been posted about before. There are known issues with the default dbms_stats parameter settings for some environements.
    What you can do is just go ahead an manually submit dbms_stats commands with appropriate parameters for tables that have not been analyzed or modify the maintenance window to give it more time.
    I would rather just generate the missing statistics myself then the job can continue to run in the normal maintenance window. Since the job should be looking only for tables that meet the stale requirements then once everything is analyzed it is likely the job can keep the statistics updated in the default time allowed.
    Be warned that the default parameter settings do not work well for some tables in some environments and if that proves true for your shop you can generate workable statistics on a table and then lock them so the nightly job ships regenerating the statistics for that table. You would then manually unlock, generate, and lock that statistics for that table as necessary.
    HTH -- Mark D Powell --

  • Finding foreign keys

    hi,
    anyone got sql that would tell which tables reference a primary key in a another table e.g. the link from primary key to foreign key in a schema?
    thanks

    query DBA_CONSTRAINTS
    SQL> desc dba_constraints
    Name                            Null?    Type
    OWNER                            NOT NULL VARCHAR2(30)
    CONSTRAINT_NAME                  NOT NULL VARCHAR2(30)
    CONSTRAINT_TYPE                        VARCHAR2(1)
    TABLE_NAME                       NOT NULL VARCHAR2(30)
    SEARCH_CONDITION                        LONG
    R_OWNER                             VARCHAR2(30)
    R_CONSTRAINT_NAME                        VARCHAR2(30)
    DELETE_RULE                             VARCHAR2(9)
    STATUS                              VARCHAR2(8)
    DEFERRABLE                             VARCHAR2(14)
    DEFERRED                             VARCHAR2(9)
    VALIDATED                             VARCHAR2(13)
    GENERATED                             VARCHAR2(14)
    BAD                                  VARCHAR2(3)
    RELY                                  VARCHAR2(4)
    LAST_CHANGE                             DATE
    INDEX_OWNER                             VARCHAR2(30)
    INDEX_NAME                             VARCHAR2(30)
    INVALID                             VARCHAR2(7)
    VIEW_RELATED                             VARCHAR2(14)

  • Query to find AP Invoices which are posted to GL

    Hi,
    I wanted to find the AP invoices which are posted to GL, any help with the query please?
    Thanks,
    Genoo

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to : All Places > Developer > English > E-Business Suite > Financials >         Discussions
    Regard
    Helios

  • Catch foreign key violations in the model, not the database

    I must do something wrong, when I want to delete a master that still has details, the application will let me, but the database returns an FK violation error when the commit button is pushed. The association is in the model, there is no viewlink though.
    Why doesn't the framework check this before the database does? And how could I make the message more userfriendly? My users have no idea what it means if BLABLA_FK is violated
    Thanks in advance

    I might have the source of this problem. I have a table that has 2 foreign keys to the same other table. In my RowImpl I get duplicate case labels when I create both viewlinks because the final int gets the name of the referring table.
    Doesn't ADF support 2 foreign keys to the same table?
    Update: a testcase showed me that I chose the same name for the accessors of 2 different viewlinks, so that was not the problem.
    Message was edited by:
    Wendy Tromp

  • Find foreign key details

    Hi,
    i want to have the details like reference tablename,reference volumn name of foreign key for a particular table.
    SELECT a.column_name, 
            c_pk.table_name r_table_name, c_pk.constraint_name r_pk
      FROM all_cons_columns a
      JOIN all_constraints c ON a.owner = c.owner
                            AND a.constraint_name = c.constraint_name
      JOIN all_constraints c_pk ON c.r_owner = c_pk.owner
                               AND c.r_constraint_name = c_pk.constraint_name
    WHERE c.constraint_type = 'R'
       AND a.table_name = :TableNameUsing this query I am getting everything except the reference column name.
    Can somebody please help?
    Thanx

    You need to add another join to ALL_CONS_COLUMNS:
    SELECT a.column_name, 
            c_pk.table_name r_table_name, c_pk.constraint_name r_pk,
            c_pk_c.column_name
      FROM all_cons_columns a
      JOIN all_constraints c ON a.owner = c.owner
                            AND a.constraint_name = c.constraint_name
      JOIN all_constraints c_pk ON c.r_owner = c_pk.owner
                               AND c.r_constraint_name = c_pk.constraint_name
      JOIN all_cons_columns c_pk_c ON c_pk_c.owner = c_pk.owner
                                  AND c_pk_c.constraint_name = c_pk.constraint_name
    WHERE c.constraint_type = 'R'
       AND a.table_name = :TableName

  • How to find Tables names which are updated or inserted data

    Hi,
    I need some help to know.
    I am submitting a form in Oracle OWS (Oracle Workforce Scheduling), but don’t know where exactly data is going in the tables or how many tables are going to updated.
    I want to know the table names which are update after the submitting the form.
    Thanks in advance....
    Regards,
    Saket

    I don't think so. Never heard of Oracle Workforce Scheduling. Is there a forum for that?
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    https://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

Maybe you are looking for

  • 'iTunes has stopped working' error message every time I try to add files

    Every time I try to add files to my iTunes, I received the erorr message and the program closes. I have uninstalled iTunes, re-installed and the problem stopped occuring after I added a few files. It's now beginning yet again. This is what the detail

  • PO from SRM to External Suppliers

    Hi, We want to implement the follow scenario : Send a PO from SRM in XML format to an external supplier using XI 3.0 , but the cuestion is whether XI has and predefinied scenario for this task , if not ,what is the recomenndaion to implement??? , we

  • KM Repository Manager

    Hi Experts,     Please give the code or documentation to develop the <b>KM Repository Manager</b> in NWDS.  Regards, Venkatesh.K. Points will be awarded.

  • OSX 10..4.7 Update Now Available - How Is It?

    The 10.4.7 OSX update is now available in Downloads!

  • IDVD halts after encoding videos but before audio

    I have made many iDVD's of our travel pictures, including both pictures and videos. However, my current iMovie won't complet e the process and always stops after encoding the videos but does not encode the audios. At that point, the gumball just sets