SQL Server 2005 Partition Table for Foreign Reference Data

Is there a canonical way to split a table into the specified data into another table?

eg

timetable
   id
   datetime

bigtable
   id
   timetable_id -- foreign key
   .. other data ..

I want to break bigtable into date and time in the schedule. Thankx.

+3
source share
2 answers

As noted here , it must be part of all unique indexes in the table that will include your primary key.

I think your only choice here is to denormalize the column timetable.datetimein bigtableso that the column is splittable.

+2
source

. id datetime timetable, :

id          datetime
1           20091001
2           20091002
3           20091003
...
32          20091101
33          20091102
...
62          20091201
...

(2009-10-01, 2009-10-31), (2009-11-01, 2009-11-30) .. id: (1,31), (32,62),... , id datetime. , datetime bigtable, id , wqitht he datetime.

+2

Source: https://habr.com/ru/post/1767194/


All Articles