Questions tagged [refactoring-databases]

32 questions
14
votes
5 answers

Best Practices for MySQL Encryption?

I'm looking for guidance on encrypting fields (and/or tables if possible) for MySQL. I will settle for a decent tutorial but I'd really like specific tips on managing the transition from an unencrypted schema to one utilizing encrypted fields.…
14
votes
10 answers

Does a version control database storage engine exist?

I was just wondering if a storage engine type existed that allowed you to do version control on row level contents. For instance, if I have a simple table with ID, name, value, and ID is the PK, I could see that row 354 started as (354, "zak",…
Zak
  • 24,947
  • 11
  • 38
  • 68
5
votes
4 answers

SQL, How to change column in SQL table without breaking other dependencies?

I'm sure this might be quite common query but couldn't find good answer as for now. Here is my question: I've got a table named Contacts with varchar column Title. Now in the middle of development I want to replace field Title with TitleID which is…
cinek
  • 1,888
  • 2
  • 13
  • 14
4
votes
2 answers

Renaming columns in a system versioned table Visual Studio SQL Project

I'm looking to have Visual Studio's SQL Schema Compare generate the delta SQL to update a production database, including a column rename on a table with system versioning on (temporal table). Using refactoring within Visual Studio SQL Project will…
4
votes
3 answers

Creating a SQL Server trigger to transition from a natural key to a surrogate key

Backstory At work where we're planning on deprecating a Natural Key column in one of our primary tables. The project consists of 100+ applications that link to this table/column; 400+ stored procedures that reference this column directly; and a vast…
3
votes
5 answers

Is there something like a "column symlink" in Oracle?

I would like to have a column in my DB accessible via two column names temporarily. Why? The column name was badly chosen, I would like to refactor it. As I want my webapp to remain stable while changing the column name, it would be good to have a…
Peter P
  • 145
  • 1
  • 5
3
votes
2 answers

How to rename SQL table column name(s) and not break stuff

I revisited some of my code from my beginner days and found that some of the SQL table column names are so ambiguous it made me cringe. Now If I go ahead and change the names, the time and effort required to correct all the mappings in the code…
kaizenCoder
  • 2,211
  • 6
  • 33
  • 64
3
votes
2 answers

How many tables/sprocs/functions in a database is too many?

I'm interested in database refactoring. I deal with several databases that don't have a large amount of data, just a few GB with at most a few hundred thousand rows. However, they have hundreds -- sometimes many hundreds -- of tables, views, sprocs…
2
votes
1 answer

SQL Server Data Tools Ignores Refactor on Schema Compare

I'm having a seemingly identical problem to what is described here: SSDT Refactor Rename is ignored by the Schema Comparison script generation. Essentially, the refactor component of SQL Server Data Tools is not working on schema comparison/update.…
2
votes
8 answers

In sql server, is there any way to check whether the schema change will impact on the stored procs?

In SQL Server, is there any way to check whether the changes in the schema will impact Stored Procedures (and/or Views)? For example a change of the column name in one table, may break some Stored Procedures; how to check the impacted stored procs?
ziang
  • 23
  • 3
2
votes
1 answer

Split large sqlite table by sessionid field

I am relatively new to sql(ite), and I'm learning as I go while working on a new project. We have got millions of transaction rows in one "data" table, one field being a "sessionid" field. Since I want to concentrate on in-session activity for now,…
simlei
  • 155
  • 2
  • 12
2
votes
1 answer

Refactoring Auto-increment ids to GUIDs in **SQL DB

Jeff and others have convinced me that GUIDs are preferable to auto-increment ids. I have a Postgres DB that is indexed by auto-increment ids so I'd like to "refactor" the indexes to UUIDs. Is there some general (or specific) approach to doing this…
ted.strauss
  • 4,119
  • 4
  • 34
  • 57
2
votes
1 answer

Db4o - how to rename a field in one step?

As I've read in db4o documentation (.net version), I supposed that to rename a field in a class I would have to add the following to my code (and renaming the actual field in the class, of course): IEmbeddedConfiguration configuration =…
Leandro Gomide
  • 998
  • 1
  • 10
  • 31
2
votes
1 answer

ArcSDE Database Refactoring Tool options

We are using liquibase as evolutionary DB change management tool in our applications, it works great when we use it in "common" database schemas. But we also work with GIS applications using esri arcSDE 9.3 platform over Oracle and in this case, all…
kothvandir
  • 2,111
  • 2
  • 19
  • 34
1
vote
1 answer

SQL Server 2016 - Get NULL values from a table using a Stored Procedure

I am trying to use a stored procedure called GetCompanies and a parameter called @ShowCompaniesWithoutClients in order to show all companies (from a table called Company) where the Client column is NULL or empty (''). At the moment the solution I…
1
2 3