Red Gate forums :: View topic - Bug in Smart Rename handling Precedence?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Prompt 6
SQL Prompt 6 forum

Bug in Smart Rename handling Precedence?

Search in SQL Prompt 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
CGLuttrell



Joined: 10 Sep 2009
Posts: 18
Location: Knoxville, TN

PostPosted: Tue Nov 19, 2013 12:23 am    Post subject: Bug in Smart Rename handling Precedence? Reply with quote

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.
Code:

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 code

Then it thows this error any place that references the Moved object before the Alter Schema statement:
Quote:
Invalid object name 'Security.Organization'.

I take it this is a bug?
Thanks,
Chris
Back to top
View user's profile Send private message AIM Address MSN Messenger
Anu Deshpande



Joined: 20 Apr 2009
Posts: 688
Location: Cambridge

PostPosted: Wed Nov 20, 2013 3:11 pm    Post subject: Reply with quote

Thanks for your post.

I have logged a support ticket for you and have emailed you.
_________________
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group