﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2008 / SQL Server 2008 - General  / SQL definition statement for synonym ? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 00:08:05 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SQL definition statement for synonym ?</title><link>http://www.sqlservercentral.com/Forums/Topic1411076-391-1.aspx</link><description>Also syscomments is depreciated, use sys.sql_modules instead</description><pubDate>Thu, 24 Jan 2013 05:34:18 GMT</pubDate><dc:creator>anthony.green</dc:creator></item><item><title>RE: SQL definition statement for synonym ?</title><link>http://www.sqlservercentral.com/Forums/Topic1411076-391-1.aspx</link><description>you want to use the system view sys.synonyms, instead, which has everything you need:[code]select * from sys.synonyms--rebuilding the command:select   'CREATE SYNONYM '   + quotename(SCHEMA_NAME(schema_id))  +'.'  + quotename(name) --ie MyView  + ' FOR '   + base_object_name --ie [SandBox].[dbo].[VW_FIXEDWIDTH]FROM sys.synonyms  --Results:/*CREATE SYNONYM [dbo].[MyView] FOR [SandBox].[dbo].[VW_FIXEDWIDTH]*/[/code]</description><pubDate>Thu, 24 Jan 2013 05:29:44 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>SQL definition statement for synonym ?</title><link>http://www.sqlservercentral.com/Forums/Topic1411076-391-1.aspx</link><description>I have  created a synonym as followsCREATE SYNONYM [dbo].[ms4] FOR [local].[Northwind].[dbo].[Products]GOand then i want to retrieve a same SQL definition statement from one of the system/db's view so i firedselect text from syscomments  where id = object_id('dbo.[ms4]')but 'text' from syscomments returns text for all other types other then synomymsyscomments contains entries for each view, rule, default, trigger, CHECK constraint, DEFAULT constraint, and stored procedure within the database. The text column contains the original SQL definition statements.   so from which table/view i can get original SQL definition statements for synonym. Its not there in syscomments . so where is they stored?</description><pubDate>Thu, 24 Jan 2013 05:23:10 GMT</pubDate><dc:creator>s_v_joshi</dc:creator></item></channel></rss>