All Questions
Tagged with alter-table database-design
14 questions
0
votes
1
answer
106
views
How do I protected my sensitive data (financial) from website/CRM programmers?
As a company owner, I need to protect my sensitive data from my website/CRM programmers. I know I can scramble DB values with a simple script but it needs to be applied manually all the time and when ...
4
votes
0
answers
1k
views
How costly is changing column datatype in PostgreSQL?
I'm currently evaluating PostgreSQL for an app we are developing which comes with a weird usecase. We want to allow clients to create new fields which in turn will create new columns in a client-...
0
votes
1
answer
2k
views
Has the ID column configured as PK, NN and AI, be the first column on my table definition?
I have a .csv file with a bunch of data which I am using for load all the data into a DB table. The file lacks the ID column (because that's is an internal column managed through our software and they ...
1
vote
1
answer
234
views
ALTER TABLE online by keeping data as BLOBs
Could you please explain me how extreme de-normalization (store the value as a serialized blob will help to ALTER TABLE online? source
Additionally, it's crucial to be able to change the schema: ...
7
votes
5
answers
17k
views
Is it bad practice to add columns to an existing table?
Conversely: Is it better to get all the columns created at the time when a new table is created?
I'm working on a new system and new requirements are coming up all the time. The latest requirement ...
1
vote
1
answer
60
views
Changing Key (PK, FK) properties in DROP/Add column statements
I want to change a table by adding a column. So far nothing to see here, BUT I would like to make this column part of a composite key, i.e., I now have a layout
table_name( Field_1 datatype PK, ...
11
votes
1
answer
7k
views
Adding nullable column to table costs more than 10 minutes
I have problems to add a new column on a table.
I tried to run it a couple of times, but after more than 10 minutes running, I decided to cancel the query because of lock time.
ALTER TABLE mytable ...
3
votes
1
answer
3k
views
Apparantly errorneous Exceeds 8K row length message
In attempting to alter an SQL Server table adding DATE and FLOAT columns. I get a message:
Warning: The table "CustomerTransactions" has been created, but its maximum row size exceeds the allowed ...
7
votes
6
answers
70k
views
How To change the column order?
How To change the column order in sql server 2008 R2?
Eg: My table order is Eid------Ename-----Esalary
Know i want this format like Eid---Salary----Ename
Thanks.
12
votes
2
answers
5k
views
Fastest way to change a 600GB table indexed key datatype from INT to BIGINT
I need to change a datatype from INT to BIGINT in a 600GB MySQL table. The column has a unique index. I might be good with unsigned INT, but I assume changing to that or BIGINT will be pretty much ...
3
votes
2
answers
29k
views
How to make a trigger that will compare input with a value of other table?
I had made two tables with the following fields:
TABLE 1: "Bookings"
FIELD: "fk_flight_number"
FIELD: "date_of_reservation"
TABLE 2: "Flights"
FIELD: "flight_number"
FIELD: "...
11
votes
1
answer
70k
views
What happens when you modify (reduce) a column's length?
Lets say I have two columns of type NUMBER (without precision, and scale) and VARCHAR(300). I saw that these columns are way too large for my data, so I want to modify them to NUMBER(11) and VARCHAR(...
7
votes
2
answers
49k
views
Add a new Column and define its position in a table
I have Table A with 5 columns:
TableA
--
Name
Tel
Email
Address
I want to add a new column (mobile) in between Tel & Email:
TableA
--
Name
Tel
Mobile
Email
Address
If I use
ALTER TABLE TableA
...
2
votes
1
answer
8k
views
Default values in SQLite3
When I created the table structure of my SQLite database, I provided a DEFAULT value which is used when no value is provided by the user. Now, because the application code changed, I need to modify ...