<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2005 &#8211; Introduction and Explanation to SYNONYM &#8211; Helpful T-SQL Feature for Developer</title>
	<atom:link href="http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Gaetan Boisvert</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-456612</link>
		<dc:creator><![CDATA[Gaetan Boisvert]]></dc:creator>
		<pubDate>Mon, 15 Apr 2013 15:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-456612</guid>
		<description><![CDATA[sorry not:   Could not find server ‘ServerRemote’...   but Could not find server ‘syn_Server’

Sorry!]]></description>
		<content:encoded><![CDATA[<p>sorry not:   Could not find server ‘ServerRemote’&#8230;   but Could not find server ‘syn_Server’</p>
<p>Sorry!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gaetan Boisvert</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-456607</link>
		<dc:creator><![CDATA[Gaetan Boisvert]]></dc:creator>
		<pubDate>Mon, 15 Apr 2013 15:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-456607</guid>
		<description><![CDATA[Hi Pinal,

Question about synonym...

Why MSSQL accept this, but we can&#039;t use this ???

CREATE SYNONYM [dbo].[syn_Server]                FOR [ServerRemote]
CREATE SYNONYM [dbo].[syn_Db]                      FOR [AdventureWorks]
CREATE SYNONYM [dbo].[syn_Employee]          FOR [syn_Server] .[syn_Db].dbo.Employee

after that, I read the synonym:

select name, base_object_name 
from sys.synonyms 
order by name

Result:

name	                 base_object_name

syn_Server	[ServerRemote]
syn_Db	                 [AdventureWorks]
syn_svDM_Schema	[dbo]
syn_Employee	[syn_Server] .[syn_Db].[syn_svDM_Schema].Employee



When I try to use synonym as:

select * from dbo.syn_Employee

I got:

Msg 7202, Level 11, State 2, Line 1
Could not find server &#039;ServerRemote&#039; in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

The question is: Why MSSQL accept the syntax when you can not use it?

Someone have a idea?

Thanks :-)]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>Question about synonym&#8230;</p>
<p>Why MSSQL accept this, but we can&#8217;t use this ???</p>
<p>CREATE SYNONYM [dbo].[syn_Server]                FOR [ServerRemote]<br />
CREATE SYNONYM [dbo].[syn_Db]                      FOR [AdventureWorks]<br />
CREATE SYNONYM [dbo].[syn_Employee]          FOR [syn_Server] .[syn_Db].dbo.Employee</p>
<p>after that, I read the synonym:</p>
<p>select name, base_object_name<br />
from sys.synonyms<br />
order by name</p>
<p>Result:</p>
<p>name	                 base_object_name</p>
<p>syn_Server	[ServerRemote]<br />
syn_Db	                 [AdventureWorks]<br />
syn_svDM_Schema	[dbo]<br />
syn_Employee	[syn_Server] .[syn_Db].[syn_svDM_Schema].Employee</p>
<p>When I try to use synonym as:</p>
<p>select * from dbo.syn_Employee</p>
<p>I got:</p>
<p>Msg 7202, Level 11, State 2, Line 1<br />
Could not find server &#8216;ServerRemote&#8217; in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.</p>
<p>The question is: Why MSSQL accept the syntax when you can not use it?</p>
<p>Someone have a idea?</p>
<p>Thanks :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bambang</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-432536</link>
		<dc:creator><![CDATA[Bambang]]></dc:creator>
		<pubDate>Wed, 06 Mar 2013 02:15:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-432536</guid>
		<description><![CDATA[Hi Pinal,

This is a great article about synonym, but i&#039;m curious,i found one of the comments (from Mike M) about connecting two different database server,and create one queries that use table on both server. can you explain or give me a simple step by step or example queries with condition you have two database server, Server A and Server B, and then you want to display output inner join tableA1 in database AA on Server A with tableB1 in Database BB on Server B, and using synonym on it,can we do that and if we can, please tell me how. i appreciate your help for helping me.
thank you.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>This is a great article about synonym, but i&#8217;m curious,i found one of the comments (from Mike M) about connecting two different database server,and create one queries that use table on both server. can you explain or give me a simple step by step or example queries with condition you have two database server, Server A and Server B, and then you want to display output inner join tableA1 in database AA on Server A with tableB1 in Database BB on Server B, and using synonym on it,can we do that and if we can, please tell me how. i appreciate your help for helping me.<br />
thank you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #011 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-406695</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #011 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 12 Jan 2013 01:30:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-406695</guid>
		<description><![CDATA[[...] Introduction and Explanation to SYNONYM – Helpful T-SQL Feature for Developer [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Introduction and Explanation to SYNONYM – Helpful T-SQL Feature for Developer [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Russ Todd</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-373182</link>
		<dc:creator><![CDATA[Russ Todd]]></dc:creator>
		<pubDate>Mon, 12 Nov 2012 22:51:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-373182</guid>
		<description><![CDATA[How would you create a disaster recovery for  2 databases  on different servers that use synonyms between each other. So we have serverA.databaseA.dbo.synonym1 pointing to serverB.databaseB.dbo.table1
but we have mirrored servers: serverA.databaseA mirrored to disasterRecoverA.databaseA and serverB.databaseB mirrored to disasterRecoverB.databaseB using sql server 2008R]]></description>
		<content:encoded><![CDATA[<p>How would you create a disaster recovery for  2 databases  on different servers that use synonyms between each other. So we have serverA.databaseA.dbo.synonym1 pointing to serverB.databaseB.dbo.table1<br />
but we have mirrored servers: serverA.databaseA mirrored to disasterRecoverA.databaseA and serverB.databaseB mirrored to disasterRecoverB.databaseB using sql server 2008R</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naraayanan</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-340785</link>
		<dc:creator><![CDATA[Naraayanan]]></dc:creator>
		<pubDate>Tue, 04 Sep 2012 10:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-340785</guid>
		<description><![CDATA[Hi Pinal Dave,
  Thanks for your information.How to use  Synonyms  in same database. For ex:i am using Thrid Party tool. Data will store into SQL.I create a Table in same database (like Employee Master).I want to store a information in my New Table .Is it possible in SYNONYMS Concept.Please clear it.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal Dave,<br />
  Thanks for your information.How to use  Synonyms  in same database. For ex:i am using Thrid Party tool. Data will store into SQL.I create a Table in same database (like Employee Master).I want to store a information in my New Table .Is it possible in SYNONYMS Concept.Please clear it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Michalicek</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-319441</link>
		<dc:creator><![CDATA[Mike Michalicek]]></dc:creator>
		<pubDate>Thu, 26 Jul 2012 19:05:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-319441</guid>
		<description><![CDATA[Thanks Dan! Simple and direct logic. I appreciate your posting and I will be implementing this change soon.]]></description>
		<content:encoded><![CDATA[<p>Thanks Dan! Simple and direct logic. I appreciate your posting and I will be implementing this change soon.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dan</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-319411</link>
		<dc:creator><![CDATA[dan]]></dc:creator>
		<pubDate>Thu, 26 Jul 2012 18:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-319411</guid>
		<description><![CDATA[Here is an update to MIKE M. script using the PARSENAME 
Select base_object_NAME
, PARSENAME(base_object_name, 4) AS &#039;Server&#039;
, PARSENAME(base_object_name, 3) AS &#039;Database&#039;
, PARSENAME(base_object_name, 2) AS &#039;Schema&#039;
, PARSENAME(base_object_name, 1) AS &#039;Object&#039;
From sys.synonyms Where name = &#039;&#039;]]></description>
		<content:encoded><![CDATA[<p>Here is an update to MIKE M. script using the PARSENAME<br />
Select base_object_NAME<br />
, PARSENAME(base_object_name, 4) AS &#8216;Server&#8217;<br />
, PARSENAME(base_object_name, 3) AS &#8216;Database&#8217;<br />
, PARSENAME(base_object_name, 2) AS &#8216;Schema&#8217;<br />
, PARSENAME(base_object_name, 1) AS &#8216;Object&#8217;<br />
From sys.synonyms Where name = &#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinay</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-307096</link>
		<dc:creator><![CDATA[vinay]]></dc:creator>
		<pubDate>Thu, 28 Jun 2012 19:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-307096</guid>
		<description><![CDATA[Hi Pinal,

I have requirement where i want to rename the tables which has depdency with many objects, is there any simple solution to rename tables having dependencies wtih that table?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,</p>
<p>I have requirement where i want to rename the tables which has depdency with many objects, is there any simple solution to rename tables having dependencies wtih that table?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saurabh M</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-305499</link>
		<dc:creator><![CDATA[Saurabh M]]></dc:creator>
		<pubDate>Mon, 25 Jun 2012 07:28:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-305499</guid>
		<description><![CDATA[Thanks Chris, I was also stuck on an issue due to this. Your post helped :)]]></description>
		<content:encoded><![CDATA[<p>Thanks Chris, I was also stuck on an issue due to this. Your post helped :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rohit Mudgal</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-282608</link>
		<dc:creator><![CDATA[Rohit Mudgal]]></dc:creator>
		<pubDate>Mon, 07 May 2012 09:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-282608</guid>
		<description><![CDATA[Hi Pinal, Whenever I search for any query or problem SQL related it always pops up yours name first, I find your articles and solutions correct and to the point. Coming to the point, I want to know what happens under the hood when we create a Synonym in SQL. As for Oracle I read it somewhere that it creates a pointer to that table. So whats the scenario in SQL? I have one more query regarding it, if in SQL also it creates a pointer then what happens when we create a Synonym for the table from a database to the linked server in SQL.?]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal, Whenever I search for any query or problem SQL related it always pops up yours name first, I find your articles and solutions correct and to the point. Coming to the point, I want to know what happens under the hood when we create a Synonym in SQL. As for Oracle I read it somewhere that it creates a pointer to that table. So whats the scenario in SQL? I have one more query regarding it, if in SQL also it creates a pointer then what happens when we create a Synonym for the table from a database to the linked server in SQL.?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sarovar</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-255589</link>
		<dc:creator><![CDATA[sarovar]]></dc:creator>
		<pubDate>Thu, 23 Feb 2012 07:40:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-255589</guid>
		<description><![CDATA[Hi pinal bai....
your doing geat job...


Thank u]]></description>
		<content:encoded><![CDATA[<p>Hi pinal bai&#8230;.<br />
your doing geat job&#8230;</p>
<p>Thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sneha</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-252329</link>
		<dc:creator><![CDATA[Sneha]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 08:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-252329</guid>
		<description><![CDATA[Hi 

Can it be done on a 2 parter like for Server.DatabaseName instead of a 4 parter?]]></description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>Can it be done on a 2 parter like for Server.DatabaseName instead of a 4 parter?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ko Ko Chit</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-177405</link>
		<dc:creator><![CDATA[Ko Ko Chit]]></dc:creator>
		<pubDate>Tue, 11 Oct 2011 06:06:25 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-177405</guid>
		<description><![CDATA[How can I delete all synonyms from one database at one time???]]></description>
		<content:encoded><![CDATA[<p>How can I delete all synonyms from one database at one time???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K Sai Harish</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-164858</link>
		<dc:creator><![CDATA[K Sai Harish]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 17:29:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-164858</guid>
		<description><![CDATA[hi.......
    this is harish. i am from cse department and i having 54% in b.tech and i would like to know how to step up into mnc&#039;s............. with oracle domain.]]></description>
		<content:encoded><![CDATA[<p>hi&#8230;&#8230;.<br />
    this is harish. i am from cse department and i having 54% in b.tech and i would like to know how to step up into mnc&#8217;s&#8230;&#8230;&#8230;&#8230;. with oracle domain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: K Sai Harish</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-164855</link>
		<dc:creator><![CDATA[K Sai Harish]]></dc:creator>
		<pubDate>Fri, 02 Sep 2011 17:22:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-164855</guid>
		<description><![CDATA[HI........
this is harish i am having 54% in b.tech and i have joined in a company and i doing sql server 2005. i would like to know how i can step into mnc&#039;s with this percentage and my domain...........]]></description>
		<content:encoded><![CDATA[<p>HI&#8230;&#8230;..<br />
this is harish i am having 54% in b.tech and i have joined in a company and i doing sql server 2005. i would like to know how i can step into mnc&#8217;s with this percentage and my domain&#8230;&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris S</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-152921</link>
		<dc:creator><![CDATA[Chris S]]></dc:creator>
		<pubDate>Tue, 02 Aug 2011 23:44:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-152921</guid>
		<description><![CDATA[I realize this is an old post but since there is no solution posted yet, here it is:

If you are running a stored procedure as a synonym on the same server, you must not specify the server name when creating the synonym.]]></description>
		<content:encoded><![CDATA[<p>I realize this is an old post but since there is no solution posted yet, here it is:</p>
<p>If you are running a stored procedure as a synonym on the same server, you must not specify the server name when creating the synonym.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 16 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-148615</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 16 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Sat, 16 Jul 2011 01:31:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-148615</guid>
		<description><![CDATA[[...] Synonyms give you the ability to provide alternate names for database objects. You can alias object names; for example, using the Employee table as Emp. You can also shorten names. This is especially useful when dealing with three and four part names; for example, shortening server.database.owner.object to object. (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Synonyms give you the ability to provide alternate names for database objects. You can alias object names; for example, using the Employee table as Emp. You can also shorten names. This is especially useful when dealing with three and four part names; for example, shortening server.database.owner.object to object. (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cal</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-120712</link>
		<dc:creator><![CDATA[Cal]]></dc:creator>
		<pubDate>Fri, 25 Feb 2011 20:45:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-120712</guid>
		<description><![CDATA[Have been MSSQL DBA for a long time and somehow I missed this feature! :)]]></description>
		<content:encoded><![CDATA[<p>Have been MSSQL DBA for a long time and somehow I missed this feature! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike M</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82085</link>
		<dc:creator><![CDATA[Mike M]]></dc:creator>
		<pubDate>Wed, 28 Jul 2010 18:49:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82085</guid>
		<description><![CDATA[There is a way of doing this but its not what you would think. I had the same need and this is what I came up with.

Setup 1 synonym for 1 DB object. You wil not be using the synonym at all. What you will be doing is pulling the Server.Database.Schema from the synonym, then use the Server.Database.Schema in String SQL.

Below is the code I am using to extract the Server.Database.Schema from the synonym. You could use the Server.Database.Schema from the synonym to dynamically build a Synonym as needed then drop when done if you do not want to use string sql.

Declare @ServerToUpdt		varchar(255)
       ,@DBToUpdt			varchar(255)
       ,@Schema				char(3)

Select @ServerToUpdt = Replace(Replace(Left(base_object_name,charindex(&#039;.&#039;,base_object_name)-1),&#039;[&#039;,&#039;&#039;),&#039;]&#039;,&#039;&#039;)
	  ,@DBToUpdt = Replace(Replace(Substring(base_object_name,
											 charindex(&#039;.&#039;,base_object_name)+1,
											 charindex(&#039;.&#039;,base_object_name,charindex(&#039;.&#039;,base_object_name)+1) - charindex(&#039;.&#039;,base_object_name) - 1)
								   ,&#039;[&#039;,&#039;&#039;),&#039;]&#039;,&#039;&#039;)
	  ,@Schema = Replace(Replace(Substring(base_object_name,
										  charindex(&#039;.&#039;,base_object_name,charindex(&#039;.&#039;,base_object_name)+1)+1,
										  charindex(&#039;.&#039;,base_object_name,charindex(&#039;.&#039;,base_object_name,charindex(&#039;.&#039;,base_object_name)+1)+1) - charindex(&#039;.&#039;,base_object_name,charindex(&#039;.&#039;,base_object_name)+1) - 1)
								,&#039;[&#039;,&#039;&#039;),&#039;]&#039;,&#039;&#039;)
From sys.synonyms Where name = &#039;icc_SaveRptParamsCutAudit&#039;

Print @ServerToUpdt
Print @DBToUpdt
Print @Schema]]></description>
		<content:encoded><![CDATA[<p>There is a way of doing this but its not what you would think. I had the same need and this is what I came up with.</p>
<p>Setup 1 synonym for 1 DB object. You wil not be using the synonym at all. What you will be doing is pulling the Server.Database.Schema from the synonym, then use the Server.Database.Schema in String SQL.</p>
<p>Below is the code I am using to extract the Server.Database.Schema from the synonym. You could use the Server.Database.Schema from the synonym to dynamically build a Synonym as needed then drop when done if you do not want to use string sql.</p>
<p>Declare @ServerToUpdt		varchar(255)<br />
       ,@DBToUpdt			varchar(255)<br />
       ,@Schema				char(3)</p>
<p>Select @ServerToUpdt = Replace(Replace(Left(base_object_name,charindex(&#8216;.&#8217;,base_object_name)-1),&#8217;[',''),']&#8216;,&#8221;)<br />
	  ,@DBToUpdt = Replace(Replace(Substring(base_object_name,<br />
											 charindex(&#8216;.&#8217;,base_object_name)+1,<br />
											 charindex(&#8216;.&#8217;,base_object_name,charindex(&#8216;.&#8217;,base_object_name)+1) &#8211; charindex(&#8216;.&#8217;,base_object_name) &#8211; 1)<br />
								   ,&#8217;[',''),']&#8216;,&#8221;)<br />
	  ,@Schema = Replace(Replace(Substring(base_object_name,<br />
										  charindex(&#8216;.&#8217;,base_object_name,charindex(&#8216;.&#8217;,base_object_name)+1)+1,<br />
										  charindex(&#8216;.&#8217;,base_object_name,charindex(&#8216;.&#8217;,base_object_name,charindex(&#8216;.&#8217;,base_object_name)+1)+1) &#8211; charindex(&#8216;.&#8217;,base_object_name,charindex(&#8216;.&#8217;,base_object_name)+1) &#8211; 1)<br />
								,&#8217;[',''),']&#8216;,&#8221;)<br />
From sys.synonyms Where name = &#8216;icc_SaveRptParamsCutAudit&#8217;</p>
<p>Print @ServerToUpdt<br />
Print @DBToUpdt<br />
Print @Schema</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike M</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82056</link>
		<dc:creator><![CDATA[Mike M]]></dc:creator>
		<pubDate>Wed, 28 Jul 2010 15:53:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82056</guid>
		<description><![CDATA[Hi Pinal,
Sorry, I should have added that in the 3 examples from my previous posting I am executing the synonym from with in a stored procedure.

The Exec MySynProc @Param1=’A&#039;, @Param2=’1′, @Param3=’Gold’ is on line 1186 of the stored procedure.

This stored procedure is used for a report in reporting services. The Synonym is a stored procedure used to update the application audit log table. I am updating the audit log from the report stored procedure because we are also saving the selected report parameter values in the audit log table.]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
Sorry, I should have added that in the 3 examples from my previous posting I am executing the synonym from with in a stored procedure.</p>
<p>The Exec MySynProc @Param1=’A&#8217;, @Param2=’1′, @Param3=’Gold’ is on line 1186 of the stored procedure.</p>
<p>This stored procedure is used for a report in reporting services. The Synonym is a stored procedure used to update the application audit log table. I am updating the audit log from the report stored procedure because we are also saving the selected report parameter values in the audit log table.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike M</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82052</link>
		<dc:creator><![CDATA[Mike M]]></dc:creator>
		<pubDate>Wed, 28 Jul 2010 15:29:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-82052</guid>
		<description><![CDATA[Hi Pinal,
I created synonym for a stored procedure with 3 input parameters. 

The synonym works great as long as the Server defined in the synonym is different from the server the synonyn is being executed.

When the synonym is executed on the same server as defined in the synonym I get the following error:
	Msg 201, Level 16, State 4, Procedure @Param1, Line 1186
	Procedure or function &#039;MyProc&#039; expects parameter &#039;@Param1&#039;, which was not supplied.

Can I not use a synonym with a stored procedure object on the same server as defined in the synonym?
Is there a system setting I need to set?
Do I need to clap my hands and spin 3 times?

For example:
Create the synonym on ProdServer.ProdDB
	USE ProdDB
	CREATE SYNONYM MySynProc
	FOR ProdServer.ProdDB.MyProc;

Using the Synonym on a different Server works great
	Log onto server ReportServer
	USE ProdDB_Rpt
	Exec MySynProc @Param1=&#039;A&#039;, @Param2=&#039;1&#039;, @Param3=&#039;Gold&#039;

Using the Synonym on the Server defined in the Synonym generates an error
	Log onto server ProdServer
	USE ProdDB_Copy
	Exec MySynProc @Param1=&#039;A&#039;, @Param2=&#039;1&#039;, @Param3=&#039;Gold&#039;

Using the Synonym on the Server &amp; database defined in the Synonym generates an error
	Log onto server ProdServer
	USE ProdDB
	Exec MySynProc @Param1=&#039;A&#039;, @Param2=&#039;1&#039;, @Param3=&#039;Gold&#039;]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
I created synonym for a stored procedure with 3 input parameters. </p>
<p>The synonym works great as long as the Server defined in the synonym is different from the server the synonyn is being executed.</p>
<p>When the synonym is executed on the same server as defined in the synonym I get the following error:<br />
	Msg 201, Level 16, State 4, Procedure @Param1, Line 1186<br />
	Procedure or function &#8216;MyProc&#8217; expects parameter &#8216;@Param1&#8242;, which was not supplied.</p>
<p>Can I not use a synonym with a stored procedure object on the same server as defined in the synonym?<br />
Is there a system setting I need to set?<br />
Do I need to clap my hands and spin 3 times?</p>
<p>For example:<br />
Create the synonym on ProdServer.ProdDB<br />
	USE ProdDB<br />
	CREATE SYNONYM MySynProc<br />
	FOR ProdServer.ProdDB.MyProc;</p>
<p>Using the Synonym on a different Server works great<br />
	Log onto server ReportServer<br />
	USE ProdDB_Rpt<br />
	Exec MySynProc @Param1=&#8217;A', @Param2=&#8217;1&#8242;, @Param3=&#8217;Gold&#8217;</p>
<p>Using the Synonym on the Server defined in the Synonym generates an error<br />
	Log onto server ProdServer<br />
	USE ProdDB_Copy<br />
	Exec MySynProc @Param1=&#8217;A', @Param2=&#8217;1&#8242;, @Param3=&#8217;Gold&#8217;</p>
<p>Using the Synonym on the Server &amp; database defined in the Synonym generates an error<br />
	Log onto server ProdServer<br />
	USE ProdDB<br />
	Exec MySynProc @Param1=&#8217;A', @Param2=&#8217;1&#8242;, @Param3=&#8217;Gold&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biju.K.S</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-73990</link>
		<dc:creator><![CDATA[Biju.K.S]]></dc:creator>
		<pubDate>Mon, 31 May 2010 09:36:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-73990</guid>
		<description><![CDATA[Hi Pinal,
You are doing a great job......,

Biju.K.S]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
You are doing a great job&#8230;&#8230;,</p>
<p>Biju.K.S</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ketan</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-70179</link>
		<dc:creator><![CDATA[ketan]]></dc:creator>
		<pubDate>Mon, 10 May 2010 20:48:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-70179</guid>
		<description><![CDATA[Pinal,

I am trying to create a synonym for first 3 part of the object (without object name itself).  

For example, I have a linked server named &quot;Legacy&quot;. What I need is a &quot;MyLegacy&quot; synonym or alias for &quot;Legacy.MyDatabase.dbo&quot;, so I can use something like MyLegacy.Table1, MyLegacy.View2 etc.

I don&#039;t want to provide an object name while creating synonyms (otherwise I will end up with huundreds of synonyms, one for each object). 

Is there any way to do this? 

Thanks.]]></description>
		<content:encoded><![CDATA[<p>Pinal,</p>
<p>I am trying to create a synonym for first 3 part of the object (without object name itself).  </p>
<p>For example, I have a linked server named &#8220;Legacy&#8221;. What I need is a &#8220;MyLegacy&#8221; synonym or alias for &#8220;Legacy.MyDatabase.dbo&#8221;, so I can use something like MyLegacy.Table1, MyLegacy.View2 etc.</p>
<p>I don&#8217;t want to provide an object name while creating synonyms (otherwise I will end up with huundreds of synonyms, one for each object). </p>
<p>Is there any way to do this? </p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S. ARULKUMAR</title>
		<link>http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-66618</link>
		<dc:creator><![CDATA[S. ARULKUMAR]]></dc:creator>
		<pubDate>Sat, 24 Apr 2010 10:39:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2008/01/07/sql-server-2005-introduction-and-explanation-to-synonym-helpful-t-sql-feature-for-developer/#comment-66618</guid>
		<description><![CDATA[dear Pinal, 

Really you are doing wonderful job
Keep It Up

best regards
Coimbatore S. Arul Kumar Msc It]]></description>
		<content:encoded><![CDATA[<p>dear Pinal, </p>
<p>Really you are doing wonderful job<br />
Keep It Up</p>
<p>best regards<br />
Coimbatore S. Arul Kumar Msc It</p>
]]></content:encoded>
	</item>
</channel>
</rss>
