• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

qualifing the tables with the appropriate schema

Hello,
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 
      from 
         network_device nd,  
         network_config nc,    
         customer_lkup cl       
      where 
        nd.device_type in ('SOS')        
        and nd.device_name like 'n03.a.com.den.net'       
        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

0
chima
Asked:
chima
  • 2
2 Solutions
 
JestersGrindCommented:
You could do something like this:

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

Greg


0
 
SharathData EngineerCommented:

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

from
schema1.network_device nd,
schema2.network_config nc,
schema3.customer_lkup cl  
0
 
chimaAuthor Commented:
Hello, JestersGrind: and Sharath_123:, I will look into both of these solutions and get to you.
0
 
chimaAuthor Commented:
thanks
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now