Can I use Synonyms Name with Dot?

I want to try thing like this:
I have set default schema for user 'AAAUser' as 'AAA' and 'BBBUser' as 'BBB'
and
create synonyms called 'DB_1.AAA.table_1' which link to 'DB_AAA..table_1'
and 'DB_1.BBB.table_1' which link to 'DB_BBB..table_1'.
So if I use AAAUser login to DB_1 and execute SQL:
Select * from DB_1..table_1
since the default schema of AAAUser is AAA, so the table is changed from DB_1..table_1 to DB_1.AAA.table_1
and there is synonym called DB_1.AAA.table_1, so it will link to DB_AAA..table_1.
And the same, if i use BBBUser login to DB_1 and call DB_1..table_1, will finally reach DB_BBB..table_1.
However, so far, it doesn't really work! I faced 2 issues:
1. If there is a table with the same name called dbo.table_1 in DB_1, even the default schema is AAA, the sql will go DB_1.dbo.table_1 directly! (I have already proved that if there is no same table name, the default schema AAA is used!)
2. I have tested the synonym:
select * from DB_1.AAA.table_1;
It doesn't work! but if i run:
select * from [DB_1.AAA.table_1];
It works!!
Why it that? Does it mean that My design above will never work?
Thanks!
Cliff

I am not able to understand what you are trying to achieve, but I think the root of your confusion is captured here:
select * from DB_1.AAA.table_1;
It doesn't work! but if i run:
select * from [DB_1.AAA.table_1];
These two SELECT are very different. The first SELECT accesses the object table_1 in the schema AAA in database DB_1. If table_1 is a synonym that may lead you to a different table.
The second SELECT accesses the object DB_1.AAA.table_1 in your default schema in the current database. There is no connection the database DB_1 or the schema AAA in that database here. The dots are just characters in the object name just like the D, B, underscore
and so on.
And specifically, the first SELECT cannot lead you to the object in the second SELECT, unless table_1 is a synonym with the value [DB_1.AAA.table_1].
Erland Sommarskog, SQL Server MVP, [email protected]

Similar Messages

  • Can I use a headset with its own mic with my iPhone?

    I know we can't use brand names with AD but I do want to know if a headset will preempt the mic on the iPhone. It seems to defeat the whole purpose of hands free driving when i have to cradle the iphone in my lap or actually hold it while talking. I also have had decreased hearing over the years (sigh) and I much prefer a wired headset that allows me to hear from both ears. People are always telling me I'm talking in a hall when I set the iphone on my lap or on the seat next to me. Any help would be greatly appreciated.

    Of course you can.
    My wife and I use Ultimate ears headsets with built in mics all the time.

  • I had Leopard on may Mac. I upgraded to Mountain Lion using Snow Leopard. I can't use my video with Mountain Lion. Can I load Snow Leopard on an external hard drive so I can use it with my camera?

    I had Leopard on may Mac. I upgraded to Mountain Lion using Snow Leopard. I can't use my video with Mountain Lion. Can I load Snow Leopard on an external hard drive so I can use it with my camera?

    First, you cannot do this if you have a Boot Camp partition.
    Second: Create a new partition.
    1. Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    After the main menu appears select Disk Utility and click on the Continue button. Select the hard drive's main entry then click on the Partition tab in the DU main window.
    2. You should see the graphical sizing window showing the existing partitions. A portion may appear as a blue rectangle representing the used space on a partition.
    3. In the lower right corner of the sizing rectangle for each partition is a resizing gadget. Select it with the mouse and move the bottom of the rectangle upwards until you have reduced the existing partition enough to create the desired new volume's size. The space below the resized partition will appear gray. Click on the Apply button and wait until the process has completed.  (Note: You can only make a partition smaller in order to create new free space.)
    4. Click on the [+] button below the sizing window to add a new partition in the gray space you freed up. Give the new volume a name, if you wish, then click on the Apply button. Wait until the process has completed.
    You should now have a new volume on the drive.
    It would be wise to have a backup of your current system as resizing is not necessarily free of risk for data loss.  Your drive must have sufficient contiguous free space for this process to work.
    Third: Install Snow Leopard.
    Boot from your Snow Leopard DVD. Follow instructions for installation being sure that before you actually install Snow Leopard you have selected the new partition as your target destination.
    Booting From An OS X Installer Disc
      1. Insert OS X Installer Disc into the optical drive.
      2. Restart the computer.
      3. Immediately after the chime press and hold down the "C" key.
      4. Release the key when the spinning gear below the dark gray Apple logo
          appears.
      5. Wait for installer to finish loading.

  • I have microsoft outlook installed on my Mac book pro, I can only use the outlook with the office server where it was setup, I can't use outlook else where, is there any way I can reset the settings in order to be able to use outlook every where?

    I have microsoft outlook installed on my Mac book pro, I can only use the outlook with the office server where it was setup, outlook won't work out of office, is there any way I can reset the settings in order to be able to use outlook every where?

    I can see my folders by clicking the X next to my name on the Inbox Folder.  So I have my folders now, just cannot see them in the left colum or see multiple windows on Outlook.  At this point, I can use the folders, just with limited functionality.  Thanks -Gina

  • How can I use Local SPAN with RSPAN ??

    How can I use Local SPAN with RSPAN ??
    I want to mirror traffics from ISP-A and ISP-B to Anomaly-detector module.
    so I had configured like this...
    C6500-A
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    monitor session 20 destination anomaly-detector-module 3 data-port 1
    monitor session 20 source remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    C6500-B
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    end
    but it was not working..
    it wasn't any change of input packet hit count when
    I'd enter a command 'show anomaly-detector module 3 data-port 1 traffic'
    was upper configuration wrong..?
    Can I use VACL configuration ?

    try to change "monitor session 10 destination remote vlan 1000 " to "monitor session 10 destination anomaly-detector-module 3 data-port 1 " on C6500-A

  • Can I use user names and password of Microsoft Office Outlook for hyperion

    I'm new to Hyperion. Can anyone tell that can I use "user names" and "passwords" of Microsoft Office Outlook for login into hyperion applications.
    I'm not talking about single sign on, but want to use same user names and passwords as that in Outlook.
    ANy suggestions?

    That depends on how your Outlook authentication is configured.
    Hyperion is generally configured to authenticate against a network directory (NTLM, MSAD or LDAP). I'm not an Outlook expert, but my Outlook user ID and password is almost always my MSAD id and password (I change clients regularly, and it's almost always the same situation). So it's also usually the same as my Hyperion ID and password.
    Ask your Outlook administrator whether it uses (or syncs with) MSAD, NTLM or LDAP. If the answer is yes, then you're in good shape because Hyperion can use these as well.
    Hope this helps,
    - Jake

  • HT1338 can I use epson 2880 with my mac book pro? 10.9.2

    can I use epson 2880 with my mac book pro? 10.9.2

    Epson names their printers (in addition to numbers). What is your printer designation?
    http://support.apple.com/kb/HT3669#epson
    Barry

  • Can I use time capsule with a ASUS (RT-N16)router?

    I will use a router with vpn. Can I use time capsule with it? And if yes, how do I connect them?

    There is no vpn built into the native firmware of N16 so I presume you are going to use third party.
    Just plug in the TC and bridge it.. ie go to Internet tab of airport utility and select connection sharing off.
    wireless then you will need to figure out.. you can setup roaming on 2.4ghz by using identical wireless name = ssid and security but lock both to different channels.. pick out of 1, 6, 11
    In a PC network make sure you use the TC with a new name.. no spaces no special characters.. same with wireless. TC also restrict wireless on 2.4ghz to only 20mhz.. if you have the N16 set to 40mhz you will have to be extra careful with channels.. 40mhz will use up two channels and only one remains.. so your household will have filled the 2.4ghz.
    Someone suggested you can turn off 2.4ghz in the TC by not naming it.. When I try that it kicks up an error that it has to be named. So perhaps someone else has a suggestion of how to turn off 2.4ghz.
    You can turn off 5ghz by unchecking it. Seems mighty strange that you cannot turn off 2.4ghz but you can turn off 5ghz.

  • Unity Express Backup: Can we use DNS name of FTP server instead of IP address?

    Gentlemen!
    In the Unity Express system, can we use DNS name of FTP server (Microsoft FTP Server) instead of IP address in the General configuartion for Backup Server?
    e.g.  FTP://FTP_Server_Name/Directory
    Additionally we need to configure/add DNS server name in the Domain Name settings under system menu. Is there any additional configuration would require for setting up FTP server with DNS entry & above config?
    Regards,
    Sky_Voice

    Hi Sky_Voice,
    This is a supported config
    Backing Up and Restoring Data
    Last Updated: May 12, 2010
    Cisco Unity Express backup and restore functions use an FTP server to store and retrieve data. The backup function copies the files from the Cisco Unity Express application to the FTP server and the restore function copies the files from the FTP server to the Cisco Unity Express application. The FTP server can reside anywhere in the network if the backup and restore functions can access it with an IP address or hostname.
    We recommend that backups be done regularly to preserve voice-mail messages and configuration data.
    Backup and restore commands are available in configuration mode and in offline mode.
    •In configuration mode, commands are available to set the following parameters:
    –Number of backup files to keep (the oldest file is deleted).
    –URL of the FTP server where the files will be stored.
    •In offline mode, perform the backup or restore procedure. Decide the following:
    –Type of files to be backed up: all files (configuration and data), only configuration files, or only data files. Data files consist of voice-mail messages. Configuration files consist of all other system and application parameters.
    –URL of the FTP server where the files will be stored.
    http://www.cisco.com/en/US/docs/voice_ip_comm/unity_exp/rel3_2/administrator/voicemail/11bkrst_ps5520_TSD_Products_Administration_Guide_Chapter.html
    Cheers!
    Rob

  • Can we use Column Names in Parameter Cursor

    Hi
    can we use Column Names in Parameter Cursor??
    DECLARE
    CURSOR Emp_Cur (P_Deptno NUMBER)
    IS
    SELECT Empno, Ename
    FROM Emp
    WHERE Deptno = P_Deptno;
    BEGIN
    FOR Emp IN Emp_Cur(10)
    LOOP
    DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
    DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
    END LOOP;
    FOR Emp IN Emp_Cur(20)
    LOOP
    DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
    DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
    END LOOP;
    END;
    In the above Program, I send Deptnumber. If i send Column names like Empno, Ename. What can i do??
    If Declare Samething Through Parameter Cursor, it doesn't accept VARCHAR2(Size)

    For parameters you don't use size, just the type (DATE, NUMBER, VARCHAR2, CLOB, ...)
    DECLARE
      CURSOR Emp_Cur (P_Ename VARCHAR2)
      IS
        SELECT Empno, Ename
        FROM Emp
        WHERE Ename = P_Ename;
    BEGIN
      FOR Emp IN Emp_Cur('SCOTT')
      LOOP
        DBMS_OUTPUT.PUT_LINE('The Employee Number is: '||emp.Empno);
        DBMS_OUTPUT.PUT_LINE('The Employee Name is: '||emp.Ename);
      END LOOP;
    END;

  • How do i run an external monitor with my macbook and change settings so that when i close the lid the signal to the monitor is not lost and i can continue using the mac with a mouse and a wireless keyboard?

    How do i run an external monitor with my macbook and change settings so that when i close the lid the signal to the monitor is not lost and i can continue using the mac with a mouse and a wireless keyboard?

    No, nothing will prevent the computer from going to sleep when you close its display except third-party hacks that are designed to do exactly that. I strongly advise against using any of those, as they may interfere with successful entry into clamshell mode (and they carry other downside risks as well). Just wait until the computer is asleep (with its sleep light pulsing), then press any key on the keyboard. It sounds as though your setup is working as it's designed to do.

  • How can I use an iPad with two itunes accounts?

    How can I use an iPad with two itunes accounts?
    Hi there
    My partner has a works iPad, which has her works Apps on (ones that are specifically made by her company and are NOT available in the App store).
    What I want to be able to do is to ALSO have my itunes account on there so that I can put all the apps I have purchased previously from my iPhone on it.
    This is so I can put on VLC player (thats already in my itunes account) so I can add videos to the iPad.
    How do I do this please?
    I tried it before by connecting it to my mac, but it wiped everything off the iPad completely and also deleted the data settings for using 3G.
    So I want to avoid this happening again the future as it had to be sent back to her head office to be sorted again.
    Any advise please?
    Thanks

    You can't. The iPad is desgined to be a 'one user' device and only really works with one apple ID at a time.
    The only way would be if she, at work and with her work apple id, downloaded your apps (repurchasing them of course).
    It's not meant to be a multiple user/multiple ID device.

  • How can i use text expander with the new Mavericks,

    how can i use text expander with the new Mavericks,

    I regret upgrading to mavericks for the same reason
    ftamez wrote:
    how can i use text expander with the new Mavericks,
    Now I have been searching - and you have to buy an app and it will cost you $34.99 (what a rip off)

  • HT202213 can i use home sharing with my wife who has a different apple id

    Can I use home sharing with my wife who has a different apple id so we dont buy the same songs twice

    Wow, great question mhaney73.  There's got to be a way.  I have that problem as well, double songs all over the place. 

  • HT4363 Can I use home sharing with FaceTime?

    Can I use home sharing with FaceTime

    Winston,
    Thanks for the promt reply. But my problem was that I did not know how to use the air play. I looked around and figured it out.
    thanks,

Maybe you are looking for

  • A way to modify the ResultProcessing.cfg file outside of TestStand?

    All, I'm looking for a way to change the style sheet path one time (not hard code it in NI_ReportGenerator.seq), would anyone know of a way how to do it with a vi or something to that affect?  The goal is to initially setup a tester (remotely, I will

  • How to create backup

    So that I can "undelete" something in case i click the wrong button?

  • CONNECT BY PRIOR and performance of Query Plan

    Anyone, I have an SQL Statement that is performing rather slow and I am trying to figure out if I could optimize it. Here is the SQL:    SELECT/*+ index(MAXIMO.EQNDX99) */         maximo.equipment.eqnum, maximo.equipment.parent, LEVEL    FROM maximo.

  • Can I got my iPhone replaced and when can I get my new one?

    Hi guys, I got some questions with my phone and am appreciated that you can answer me. I bought my 16GB iPhone 4 a year ago and it was out of warranty after February. Originally it was locked to fido (the Canadian carrier), but it was factory unlocke

  • SQL Insert and Select statements on same page

    Newbie here. Is it possible to insert data from a form to a database and then get data from the database using "select" from the same page. I have a form that submits the authors details to an Access database but I need to get the AuthorID (which is