Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Synonyms on a table Expand / Collapse
Author
Message
Posted Wednesday, April 12, 2006 7:12 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, February 11, 2013 12:17 AM
Points: 144, Visits: 47

Hi All,

I have a synonym on a base table. The base table is changed as per some logic. Somehow I am unable to trucate the table using the synonym.

If synonym is defined on the base table, and if I say
"trucate table dbo.<synonym>", it gives error as.

Msg 1088, Level 16, State 7, Line 1

Cannot find the object "<synonym name>" because it does not exist or you do not have permissions.

I do have permission on the synonym, as I am the database owner.

Any updates from you guys is welcome.

Post #272673
Posted Wednesday, April 12, 2006 8:47 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, March 13, 2014 10:40 AM
Points: 1,035, Visits: 408
Generally speaking DDL is not allowed on synonyms.


/*****************

If most people are not willing to see the difficulty, this is mainly because, consciously or unconsciously, they assume that it will be they who will settle these questions for the others, and because they are convinced of their own capacity to do this. -Friedrich August von Hayek



*****************/
Post #272925
Posted Thursday, May 02, 2013 3:44 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, March 20, 2014 10:34 AM
Points: 6, Visits: 129
I have two databases in one instance of SQL Server. In DB1 I have Table_1 and in DB2 I have a synonym that points to Table_1 in DB1. Whenever I want to clear out the contents of DB1.dbo.Table_1 from DB2 I just use:

DELETE TOP (100) PERCENT
FROM DB2.dbo.synonym_for_Table_1

This seems to work fine for me.
Post #1448740
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse