Can a database be reorganized in SQL Server?

We have a relatively new database project that we have been writing views and stored procedures for the last 6 months or so.

  • Work with the database
  • Presentation Work
  • Saved procedures work

However, the general scope of the project has grown significantly since the launch of this project, and now some of the table names and field names are slightly behind the base.

For example, the main table in the database is called SheetMetalRequest, but the project has grown to the point where the actual sheet metal query is now one of the enumerated query types. So, the name on this table is misleading for people in the project.

In addition to this main table, other tables have different columns that also need to be changed (for example, SheetMetalRequestID).

The problem with this change is 10 different views and 30 stored procedures, which are now part of this database. Naturally, if something has changed, and not everything has changed with it, our working database of preliminary preparation can take several man-hours to return to working condition.

It would be GREAT if there was a Refactor opportunity, something like what exists in Visual Studio.

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY('productlevel'), SERVERPROPERTY('edition')

productversion | productlevel | edition
10.0.1600.22   | RTM          | Standard Edition (64-bit)
+3
source share
2 answers

, SSDT, - , . " " , .

, .

CREATE SYNONYM dbo.Requests FOR dbo.SheetMetalRequest;

, . , ( , SSDT, SQL ), :

BEGIN TRANSACTION;
    DROP SYNONYM dbo.Requests;
    EXEC sp_rename 'dbo.SheetMetalRequest', 'Requests', 'OBJECT';
COMMIT TRANSACTION

( sp_refreshsqlmodule , , , .)

( / , ), .

+3
+1

All Articles