{"id":1976,"date":"2019-05-04T16:13:57","date_gmt":"2019-05-04T09:13:57","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=1976"},"modified":"2020-04-11T20:12:07","modified_gmt":"2020-04-11T13:12:07","slug":"sql-server-synonym","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/","title":{"rendered":"SQL Server Synonym"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn about SQL Server synonym and how to create synonyms for database objects.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='what-is-a-synonym-in-sql-server'>What is a synonym in SQL Server <a href=\"#what-is-a-synonym-in-sql-server\" class=\"anchor\" id=\"what-is-a-synonym-in-sql-server\" title=\"Anchor for What is a synonym in SQL Server\">#<\/a><\/h2>\n\n\n\n<p>In SQL Server, a synonym is an alias or alternative name for a database object such as a table, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/\">view<\/a>, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-stored-procedures\/\">stored procedure<\/a>, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/\">user-defined function<\/a>, and <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-sequence\/\">sequence<\/a>. A synonym provides you with many benefits if you use it properly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-create-synonym-statement-syntax'>SQL Server CREATE SYNONYM statement syntax <a href=\"#sql-server-create-synonym-statement-syntax\" class=\"anchor\" id=\"sql-server-create-synonym-statement-syntax\" title=\"Anchor for SQL Server &lt;code&gt;CREATE SYNONYM&lt;\/code&gt; statement syntax\">#<\/a><\/h2>\n\n\n\n<p>To create a synonym, you use the <code>CREATE SYNONYM<\/code> statement as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">SYNONYM<\/span> &#91; schema_name_1. ] synonym_name \n<span class=\"hljs-keyword\">FOR<\/span> <span class=\"hljs-keyword\">object<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>The object is in the following form:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">&#91; server_name.&#91; database_name ] . &#91; schema_name_2 ]. object_name   \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, specify the target <code>object<\/code> that you want to assign a synonym in the <code>FOR<\/code> clause<\/li><li>Second, provide the name of the synonym after the <code>CREATE SYNONYM<\/code> keywords<\/li><\/ul>\n\n\n\n<p>Note that the object for which you create the synonym does not have to exist at the time the synonym is created.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-create-synonym-statement-examples'>SQL Server CREATE SYNONYM statement examples <a href=\"#sql-server-create-synonym-statement-examples\" class=\"anchor\" id=\"sql-server-create-synonym-statement-examples\" title=\"Anchor for SQL Server &lt;code&gt;CREATE SYNONYM&lt;\/code&gt; statement examples\">#<\/a><\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using the <code>CREATE SYNONYM<\/code> statement to get a better understanding.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='a-creating-a-synonym-within-the-same-database-example'>A) Creating a synonym within the same database example <a href=\"#a-creating-a-synonym-within-the-same-database-example\" class=\"anchor\" id=\"a-creating-a-synonym-within-the-same-database-example\" title=\"Anchor for A) Creating a synonym within the same database example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>CREATE SYNONYM<\/code> statement to create a synonym for the <code>sales.orders<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">SYNONYM<\/span> orders <span class=\"hljs-keyword\">FOR<\/span> sales.orders;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Once the <code>orders<\/code> synonym is created, you can reference it in anywhere which you use the target object (<code>sales.orders<\/code> table).<\/p>\n\n\n\n<p>For example, the following query uses the <code>orders<\/code> synonym instead of <code>sales.orders<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> orders;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='b-creating-a-synonym-for-a-table-in-another-database'>B) Creating a synonym for a table in another database <a href=\"#b-creating-a-synonym-for-a-table-in-another-database\" class=\"anchor\" id=\"b-creating-a-synonym-for-a-table-in-another-database\" title=\"Anchor for B) Creating a synonym for a table in another database\">#<\/a><\/h3>\n\n\n\n<p>First, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-create-database\/\">create a new database<\/a> named <code>test<\/code> and set the current database to <code>test<\/code>:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">DATABASE<\/span> <span class=\"hljs-keyword\">test<\/span>;\nGO\n\n<span class=\"hljs-keyword\">USE<\/span> <span class=\"hljs-keyword\">test<\/span>;\nGO\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Next, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-create-schema\/\">create a new schema<\/a> named <code>purchasing<\/code> inside the <code>test<\/code> database:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">SCHEMA<\/span> purchasing;\nGO\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Then, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-create-table\/\">create a new table<\/a> in the <code>purchasing<\/code> schema of the <code>test<\/code> database:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> purchasing.suppliers\n(\n    supplier_id   <span class=\"hljs-built_in\">INT<\/span>\n    PRIMARY <span class=\"hljs-keyword\">KEY<\/span> <span class=\"hljs-keyword\">IDENTITY<\/span>, \n    supplier_name <span class=\"hljs-keyword\">NVARCHAR<\/span>(<span class=\"hljs-number\">100<\/span>) <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>\n);\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>After that, from the <code>BikeStores<\/code> database, create a synonym for the <code>purchasing.suppliers<\/code> table in the <code>test<\/code> database:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">SYNONYM<\/span> suppliers \n<span class=\"hljs-keyword\">FOR<\/span> test.purchasing.suppliers;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Finally, from the <code>BikeStores<\/code> database, refer to the <code>test.purchasing.suppliers<\/code> table using the <code>suppliers<\/code> synonym:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> * <span class=\"hljs-keyword\">FROM<\/span> suppliers;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='listing-all-synonyms-of-a-database'>Listing all synonyms of a database <a href=\"#listing-all-synonyms-of-a-database\" class=\"anchor\" id=\"listing-all-synonyms-of-a-database\" title=\"Anchor for Listing all synonyms of a database\">#<\/a><\/h2>\n\n\n\n<p>You can view all synonyms of a database by using Transact-SQL and SQL Server Management Studio.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='a-listing-synonyms-using-transact-sql-command'>A) Listing synonyms using Transact-SQL command <a href=\"#a-listing-synonyms-using-transact-sql-command\" class=\"anchor\" id=\"a-listing-synonyms-using-transact-sql-command\" title=\"Anchor for A) Listing synonyms using Transact-SQL command\">#<\/a><\/h3>\n\n\n\n<p>To list all synonyms of the current database, you query from the <code>sys.synonyms<\/code> catalog view as shown in the following query:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span> \n    <span class=\"hljs-keyword\">name<\/span>, \n    base_object_name, \n    <span class=\"hljs-keyword\">type<\/span>\n<span class=\"hljs-keyword\">FROM<\/span> \n    sys.synonyms\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span> \n    <span class=\"hljs-keyword\">name<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here is the output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"246\" height=\"58\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png\" alt=\"SQL Server Synonym Example\" class=\"wp-image-1977\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='b-listing-synonyms-using-sql-server-management-studio'>B) Listing synonyms using SQL Server Management Studio <a href=\"#b-listing-synonyms-using-sql-server-management-studio\" class=\"anchor\" id=\"b-listing-synonyms-using-sql-server-management-studio\" title=\"Anchor for B) Listing synonyms using SQL Server Management Studio\">#<\/a><\/h3>\n\n\n\n<p>From the SQL Server Management Studio, you can view all synonym of the current database via <strong>Synonyms<\/strong> node as shown in the following picture:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"337\" height=\"268\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-using-SSMS.png\" alt=\"SQL Server Synonym using SSMS\" class=\"wp-image-1978\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-using-SSMS.png 337w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-using-SSMS-300x239.png 300w\" sizes=\"auto, (max-width: 337px) 100vw, 337px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id='removing-a-synonym'>Removing a synonym <a href=\"#removing-a-synonym\" class=\"anchor\" id=\"removing-a-synonym\" title=\"Anchor for Removing a synonym\">#<\/a><\/h2>\n\n\n\n<p>To remove a synonym, you use the <code>DROP SYNONYM<\/code> statement with the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">SYNONYM<\/span> &#91; <span class=\"hljs-keyword\">IF<\/span> <span class=\"hljs-keyword\">EXISTS<\/span> ] &#91;schema.] synonym_name  \n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, specify the synonym name that you want to remove after the <code>DROP SYNONYM<\/code> keywords.<\/li><li>Second, use the <code>IF EXISTS<\/code> to conditionally drop the synonym only if it exists. Removing a non-existing synonym without the <code>IF EXISTS<\/code> option will result in an error.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='removing-synonyms-example'>Removing synonyms example <a href=\"#removing-synonyms-example\" class=\"anchor\" id=\"removing-synonyms-example\" title=\"Anchor for Removing synonyms example\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>DROP SYNONYM<\/code> statement to drop the orders synonym:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">DROP<\/span> <span class=\"hljs-keyword\">SYNONYM<\/span> <span class=\"hljs-keyword\">IF<\/span> <span class=\"hljs-keyword\">EXISTS<\/span> orders;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='when-to-use-synonyms'>When to use synonyms <a href=\"#when-to-use-synonyms\" class=\"anchor\" id=\"when-to-use-synonyms\" title=\"Anchor for When to use synonyms\">#<\/a><\/h2>\n\n\n\n<p>You will find some situations which you can effectively use synonyms.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='1-simplify-object-names'>1) Simplify object names <a href=\"#1-simplify-object-names\" class=\"anchor\" id=\"1-simplify-object-names\" title=\"Anchor for 1) Simplify object names\">#<\/a><\/h3>\n\n\n\n<p>If you refer to an object from another database (even from a remote server), you can create a synonym in your database and reference to this object as it is in your database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='2-enable-seamless-object-name-changes'>2) Enable seamless object name changes <a href=\"#2-enable-seamless-object-name-changes\" class=\"anchor\" id=\"2-enable-seamless-object-name-changes\" title=\"Anchor for 2) Enable seamless object name changes\">#<\/a><\/h3>\n\n\n\n<p>When you want to <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-rename-table\/\">rename a table<\/a> or any other object such as a <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-views\/\">view<\/a>, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-stored-procedures\/\">stored procedure<\/a>, <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-user-defined-functions\/\">user-defined function<\/a>, or a <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-sequence\/\">sequence<\/a>, the existing database objects that reference to this table need to be manually modified to reflect the new name. In addition, all current applications that use this table need to be changed and possibly to be recompiled. To avoid all of these hard work, you can rename the table and create a synonym for it to keep existing applications function properly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='benefits-of-synonyms'>Benefits of synonyms <a href=\"#benefits-of-synonyms\" class=\"anchor\" id=\"benefits-of-synonyms\" title=\"Anchor for Benefits of synonyms\">#<\/a><\/h2>\n\n\n\n<p>Synonym provides the following benefit if you use them properly:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Provide a layer of abstraction over the base objects.<\/li><li>Shorten the lengthy name e.g., a <code>very_long_database_name.with_schema.and_object_name<\/code> with a simplified alias.<\/li><li>Allow backward compatibility for the existing applications when you rename database objects such as tables, views, stored procedures, user-defined functions, and sequences.<\/li><\/ul>\n\n\n\n<p>In this tutorial, you have learned how to about the SQL Server synonyms and how to use them effectively in your applications.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"1976\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/\"\n\t\t\t\tdata-post-title=\"SQL Server Synonym\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"1976\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/\"\n\t\t\t\tdata-post-title=\"SQL Server Synonym\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":100,"menu_order":62,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1976","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Ultimate Guide to SQL Server Synonym By Practical Examples<\/title>\n<meta name=\"description\" content=\"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Ultimate Guide to SQL Server Synonym By Practical Examples\" \/>\n<meta property=\"og:description\" content=\"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-11T13:12:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/\",\"name\":\"The Ultimate Guide to SQL Server Synonym By Practical Examples\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-Synonym-Example.png\",\"datePublished\":\"2019-05-04T09:13:57+00:00\",\"dateModified\":\"2020-04-11T13:12:07+00:00\",\"description\":\"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-Synonym-Example.png\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-Synonym-Example.png\",\"width\":246,\"height\":58,\"caption\":\"SQL Server Synonym Example\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-synonym\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Basics\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server Synonym\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Ultimate Guide to SQL Server Synonym By Practical Examples","description":"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/","og_locale":"en_US","og_type":"article","og_title":"The Ultimate Guide to SQL Server Synonym By Practical Examples","og_description":"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2020-04-11T13:12:07+00:00","og_image":[{"url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/","name":"The Ultimate Guide to SQL Server Synonym By Practical Examples","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png","datePublished":"2019-05-04T09:13:57+00:00","dateModified":"2020-04-11T13:12:07+00:00","description":"This tutorial explains you the SQL Server synonym and shows you step by step how to create synonyms for database objects.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-Synonym-Example.png","width":246,"height":58,"caption":"SQL Server Synonym Example"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-synonym\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Basics","item":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/"},{"@type":"ListItem","position":3,"name":"SQL Server Synonym"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/1976","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=1976"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/1976\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/100"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=1976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}