0

My Customer want to create new table everyday, e.g. MyTable<yyyymmdd>, and then my application will read this table and do some cross-check. After done all cross-check, I need to drop this table. Every day will be create and drop table.

Is it good solution? could be database will crash because of this?

please advice me.

  • i already give another solution, which customer just insert the data into one table. After that, I'll delete all records once done. But customer refuse to use my solution.
Kara
  • 6,115
  • 16
  • 50
  • 57
Sh4m
  • 1,424
  • 12
  • 30
  • Maybe you could achieve the same with just creating a view? (and dropping it again if the customer insists) – Filburt Apr 14 '13 at 09:05
  • create a view is ok, no problem with that.. but is it this operation of creating and deleting not affected of DB structure or any part of DB. I feel like DB will going problem with this operation. – Sh4m Apr 14 '13 at 13:25
  • Creating and dropping a view will do absolutely no harm to your database and should satisfy your technical needs as well as your customers superstitious requirements. – Filburt Apr 14 '13 at 17:07
  • Rather than drop and re-create the table perhaps you could truncate it, e.g. `EXECUTE IMMEDIATE 'TRUNCATE TABLE MY_TABLE'`. – Bob Jarvis - Слава Україні Apr 15 '13 at 01:43

2 Answers2

4

this is a simple life cycle issue. use interval partitioning. easy to manage, good for performance.

haki
  • 9,389
  • 15
  • 62
  • 110
2

There is no point in creating and dropping the table with the same columns everyday. If the columns in that table are changing everyday you can go ahead with the approach.

Your database will not crash because of this. Just make sure that services are not accessing the table when it is dropped.

Akshay Kekre
  • 254
  • 2
  • 10
  • column is same.. but customer still want have daily table.. i just worried for create and drop operation that db could be crash. are you sure DB will not crash because of this? because i feel like table is one of DB structure, and DB structure cannot simple move/modified many time. please correct me if im wrong. – Sh4m Apr 14 '13 at 13:21