qualifing the tables with the appropriate schema

Posted on 2009-05-01
Last Modified: 2013-11-16
Given the code/script attached, how would one qualify the tables.  How would one identify the "appropriate schmea."  Obviously I am new at this, I'll have to do some studying this weekend.
select    cl.home_phone, cl.src_acct_nbr, cl.hsd_prod_flg, cl.video_prod_flg, cl.tele_prod_flg, nc.network_id,

          nc.node, nd.device_name, cl.node, cl.customer_id 


         network_device nd,  

         network_config nc,    

         customer_lkup cl       


        nd.device_type in ('SOS')        

        and nd.device_name like ''       

        and nd.device_name = nc.sos

        and nc.network_id = cl.network_id 

        and cl.last_actv_dt > cl.last_disconnect_dt    

        and nd.system_id = '007'

Open in new window

Question by:chima
    LVL 21

    Accepted Solution

    You could do something like this:

    SELECT SCHEMA_NAME([schema_id]) + '.' + [Name]
    FROM sys.tables AS t
    WHERE [name] = 'Yourtablename'


    LVL 40

    Assisted Solution


    Do you want to know in which schema, you have the tables or do you want to qualify your tables like

    schema1.network_device nd,
    schema2.network_config nc,
    schema3.customer_lkup cl  

    Author Comment

    Hello, JestersGrind: and Sharath_123:, I will look into both of these solutions and get to you.

    Author Closing Comment


    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now