Synonyms 2

  • Comments posted to this topic are about the item Synonyms 2

  • This code

    CREATE SYNONYM Emp

    FOR Human.Resources.Employee

    ;

    go

    select

    BusinessEntityID

    , NationalIDNumber

    , JobTitle

    from Emp

    ;

    will not work as there is no such thing as

    Human.Resources.Employee

    Try it out if you don't have the AWDB

    CREATE SYNONYM FLEH

    FOR sy.s.columns;

    GO

    SELECT

    *

    FROM FLEH;

    DROP SYNONYM FLEH;

    😎

    Edit: There was a typo in the question, Steve fixed it straight away;-)

  • Thanks. Corrected.

    That's what I get for typing the question instead of cut/paste

  • Steve Jones - SSC Editor (9/13/2014)


    Thanks. Corrected.

    That's what I get for typing the question instead of cut/paste

    So u should consider using cut/paste instead 😀

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • Eazy mozo 🙂

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • basic question.

    Vimal LohaniSQL DBA | MCP (70-461,70-462)==============================The greatest barrier to success is the fear of failure ** Success is a journey not a destination**Think before you print, SAVE TREES, Protect Mother Nature

  • Easy one to start the week, thanks. 🙂

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • This was removed by the editor as SPAM

  • An easy one to start the week to be sure, but it had me re-reading the question 3 times and looking at the code a couple of times because I didn't see the trick. It was almost too easy to not have a trick in there somewhere. Nonetheless, if you're not familiar with synonyms, it's a good learning opportunity. Sometimes the simple things teach the most because they reach the people without making them do a pile of work to get the point.

  • Easy one, Steve.

    Thanks!

    ---------------
    Mel. 😎

  • I know nothing about synonyms but I thought "what good would it be if you couldn't use it in a simple select?".

    🙂

    Tom

  • Ed Wagner (9/15/2014)


    An easy one to start the week to be sure, but it had me re-reading the question 3 times and looking at the code a couple of times because I didn't see the trick. It was almost too easy to not have a trick in there somewhere.

    +1. Was thinking the same thing...

  • Thank you, Steve, good one.

    ww; Raghu
    --
    The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.

  • Everybody loves a good synonym now and then. It's more fun with a bad synonym though.

    Thanks for the question Steve.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • I got it wrong because he talked about 4-part naming and then only used a 2-part name.

    It seems if he says he's "working in" the database, that mean he's connected (presumably in SSMS) so that the server and database are known?

Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic. Login to reply