Bug in Smart Rename handling Precedence?
CGLuttrell
Posts: 39 Bronze 1
I am seeing an odd behavior in the SMART RENAME that I normally consider to handle precedence correctly.
I was looking at moving a table to a different SCHEMA and this is a small snippit from the middle showing that it is trying to alter objects to refer to the moved table before moving the table.
Thanks,
Chris
I was looking at moving a table to a different SCHEMA and this is a small snippit from the middle showing that it is trying to alter objects to refer to the moved table before moving the table.
other code above this ... PRINT N'Creating trigger [Security].[trgOrganizationSnapShotInsertUpdate] on [Security].[Organization]' GO -- ============================================= -- Author: Chris Luttrell -- Create date: Sep 19 2013 10:52:12:340PM -- Description: Save all inserts and updates into the SnapShot table. -- -- mm/dd/yy Name Release Description -- 09/30/13 CGL 4.4 Added OrganizationHierarchyId to the list of columns -- ============================================= CREATE TRIGGER Security.trgOrganizationSnapShotInsertUpdate ON Security.Organization AFTER INSERT,UPDATE AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; IF UPDATE(LastModifiedDt) BEGIN INSERT INTO [SnapShot].Organization (PartyId, OrganizationBreakdownStructure, Name, OrganizationHierarchyId, ParentId, SortOrder, CreatedDt, CreatedBy, CreatedAs, LastModifiedDt, LastModifiedBy, LastModifiedAs) SELECT O.PartyId, O.OrganizationBreakdownStructure, O.Name, O.OrganizationHierarchyId, O.ParentId, O.SortOrder, O.CreatedDt, O.CreatedBy, O.CreatedAs, O.LastModifiedDt, O.LastModifiedBy, O.LastModifiedAs FROM INSERTED O END END GO IF @@ERROR<>0 AND @@TRANCOUNT>0 ROLLBACK TRANSACTION GO IF @@TRANCOUNT=0 BEGIN INSERT INTO #tmpErrors (Error) SELECT 1 BEGIN TRANSACTION END GO ALTER SCHEMA [Security] TRANSFER [Contact].[Organization] GO ... continued codeThen it thows this error any place that references the Moved object before the Alter Schema statement:
I take it this is a bug?Invalid object name 'Security.Organization'.
Thanks,
Chris
Comments
I have logged a support ticket for you and have emailed you.
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com