Moving/Renaming a Table to a new Schema not working

I used the File Mapping to rename a table from "misc.Audit" to "audit.General_Audit"

The SQL created was thus:
IF (OBJECT_ID(N'[misc].[Audit]', 'U') IS NOT NULL) AND (OBJECT_ID(N'[audit].[General_Audit]', 'U') IS NULL)
EXEC sp_rename N'[misc].[Audit]', N'General_Audit', N'OBJECT'
GO
IF (OBJECT_ID(N'[misc].[Audit]', 'U') IS NOT NULL) AND (OBJECT_ID(N'[audit].[General_Audit]', 'U') IS NULL)
ALTER SCHEMA [audit] TRANSFER [misc].[General_Audit]

#2 will not execute as misc.Audit has been renamed in #1

After a successful running of the script, I have a table
misc.General_Audit
Tagged:

Comments

  • sburrowssburrows Posts: 5 Bronze 1
    Have tried 12.2, it does the same
  • I'm sorry you're experiencing this problem. It seems to be a bug in SQL Compare. I've filed a bug report with ID SC-9455 and I'll let you know when I have any updates about a possible bugfix.

    Apologies.
    Software Engineer
    Redgate Software
  • Hi sburrows,

    This has been resolved in the latest version of SQL Compare which was released yesterday 12.4.2.4681.

    please let me know if after installing this your issue remains.
    Kind regards,
    Dan Bainbridge
    Product Support Engineer | Redgate Software
Sign In or Register to comment.