September 13, 2014 at 2:18 pm
Comments posted to this topic are about the item Synonyms 2
September 13, 2014 at 2:39 pm
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;-)
September 13, 2014 at 3:07 pm
Thanks. Corrected.
That's what I get for typing the question instead of cut/paste
September 14, 2014 at 12:48 am
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
September 14, 2014 at 12:49 am
Eazy mozo 🙂
Thanks & Best Regards,
Hany Helmy
SQL Server Database Consultant
September 14, 2014 at 11:58 pm
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
September 15, 2014 at 12:40 am
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
September 15, 2014 at 5:09 am
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.
September 15, 2014 at 6:23 am
Easy one, Steve.
Thanks!
---------------
Mel. 😎
September 15, 2014 at 6:42 am
I know nothing about synonyms but I thought "what good would it be if you couldn't use it in a simple select?".
🙂
Tom
September 15, 2014 at 7:08 am
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...
September 15, 2014 at 7:23 am
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.
September 15, 2014 at 8:23 am
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
September 15, 2014 at 8:50 am
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?
September 15, 2014 at 1:21 pm
"A synonym is used to create a short name for an object, replacing the four part naming of an object with a shorter name."
Not entirely accurate as Four-part names for function base objects are not supported. Synonyms are restricted to using three part naming of functions. 🙂
Aigle de Guerre!
Viewing 15 posts - 1 through 15 (of 17 total)
You must be logged in to reply to this topic. Login to reply