{"id":317,"date":"2017-09-19T22:10:07","date_gmt":"2017-09-19T22:10:07","guid":{"rendered":"http:\/\/www.manualsqlserver.com\/?p=317"},"modified":"2020-05-18T23:06:01","modified_gmt":"2020-05-18T23:06:01","slug":"sinonimos","status":"publish","type":"post","link":"https:\/\/manualsqlserver.com\/?p=317","title":{"rendered":"Sin\u00f3nimos en SQL Server"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"246\" src=\"https:\/\/manualsqlserver.com\/wp-content\/uploads\/2020\/05\/ManualSQL_SinonimosD.png\" alt=\"\" class=\"wp-image-1008\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Sin\u00f3nimos<\/strong><\/h2>\n\n\n\n<p>Se lo puede definir como un identificador de un objeto en la BD. \u00a0El objeto del que se crea el sin\u00f3nimo no es necesario que exista al momento de crear el sin\u00f3nimo, SQL Server \u00a0comprueba la existencia del objeto en tiempo de ejecuci\u00f3n.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>Los sin\u00f3nimos pueden reducir los errores al hacer referencia a los objetos en instrucciones Transact SQL. Los sin\u00f3nimos se crean en la base de datos abierta.<br><script>&lt;br \/>      (adsbygoogle = window.adsbygoogle || []).push({});&lt;br \/> <\/script><\/p>\n\n\n\n<p><strong>Se pueden crear sin\u00f3nimos para:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Assembly (CLR) Stored Procedure<\/li><li>Assembly (CLR) Table-valued Function<\/li><li>Assembly (CLR) Scalar Function<\/li><li>Assembly Aggregate (CLR) Aggregate<\/li><li>Functions Replication-filter-procedure<\/li><li>Extended Stored Procedure<\/li><li>SQL Scalar Function (<a href=\"http:\/\/www.manualsqlserver.com\/?cat=7\">Ver Funciones<\/a>)<\/li><li>SQL Table-valued Function (<a href=\"http:\/\/www.manualsqlserver.com\/?p=657\">Ver FDU con valores de tabla<\/a>)<\/li><li>SQL Inline-table-valued Function<\/li><li>SQL Stored Procedure (<a href=\"http:\/\/www.manualsqlserver.com\/?p=314\">Ver Procedimientos Almacenados<\/a>)<\/li><li>Vista (<a href=\"http:\/\/www.manualsqlserver.com\/?p=310\">Ver Vistas<\/a>)<\/li><li>Tabla (definida por el usuario) (<a href=\"http:\/\/www.manualsqlserver.com\/?p=117\">Ver Tablas<\/a>)<\/li><\/ul>\n\n\n\n<script async src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n<ins class=\"adsbygoogle\"\n     style=\"display:block; text-align:center;\"\n     data-ad-layout=\"in-article\"\n     data-ad-format=\"fluid\"\n     data-ad-client=\"ca-pub-2636008503986218\"\n     data-ad-slot=\"1902193434\"><\/ins>\n<script>\n     (adsbygoogle = window.adsbygoogle || []).push({});\n<\/script>\n\n\n\n<h3 class=\"wp-block-heading\">SINTAXIS<\/h3>\n\n\n\n<p>Create synonym [Esquema.]NombreSinonimo for Objeto<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Ejercicios<\/h2>\n\n\n\n<p><strong>Usando la base de datos Northwind<\/strong><\/p>\n\n\n\n<p>use Northwind<br>go<\/p>\n\n\n\n<p><strong>Para listar las categor\u00edas.<\/strong><br>select * from Northwind.dbo.Categories<br>go<br><strong>Crea un sin\u00f3nimo para categor\u00edas llamado Cats<\/strong><br>Create synonym Cats for Northwind.dbo.Categories<br>go<br><strong>Para listar Categor\u00edas usando el sin\u00f3nimo<\/strong><br>Select * from Cats<br>go<\/p>\n\n\n\n<p><strong>La Tabla Culture en el esquema Production de la BD AdventureWorks<\/strong><br>Create synonym Cul for Adventureworks.Production.Culture<br>go<br><strong>Listar las culturas<\/strong><br>select * from Cul<br>go<\/p>\n\n\n\n<p><strong>Listar los sin\u00f3nimos de la base de datos<\/strong><br>select * from sys.synonyms<br>go<\/p>\n\n\n\n<p><strong>Para eliminar un sin\u00f3nimo se utiliza<\/strong><br>Drop synonym NombreSin\u00f3nimo<\/p>\n\n\n\n<p><script async=\"\" src=\"\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script><br><ins class=\"adsbygoogle\" style=\"display: block; text-align: center;\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\" data-ad-client=\"ca-pub-8212748961777604\" data-ad-slot=\"1807313726\"><\/ins><br><script><br \/>\n     (adsbygoogle = window.adsbygoogle || []).push({});<br \/>\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sin\u00f3nimos Se lo puede definir como un identificador de un objeto en la BD. \u00a0El objeto del que se crea el sin\u00f3nimo no es necesario que exista al momento de crear el sin\u00f3nimo, SQL Server \u00a0comprueba la existencia del objeto en tiempo de ejecuci\u00f3n.<\/p><p><a class=\"more-link btn\" href=\"https:\/\/manualsqlserver.com\/?p=317\">Seguir leyendo<\/a><\/p>\n","protected":false},"author":1,"featured_media":1008,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[69,53],"class_list":["post-317","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programacion","tag-sinonimos","tag-sqlserver","nodate","item-wrap"],"_links":{"self":[{"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/posts\/317","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=317"}],"version-history":[{"count":1,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/posts\/317\/revisions"}],"predecessor-version":[{"id":1010,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/posts\/317\/revisions\/1010"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=\/wp\/v2\/media\/1008"}],"wp:attachment":[{"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=317"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=317"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/manualsqlserver.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=317"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}