-
Notifications
You must be signed in to change notification settings - Fork 1
/
query_for_truncatetables.sql
61 lines (47 loc) · 2.24 KB
/
query_for_truncatetables.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
ALTER TABLE [dbo].[FactFootballTeamScore] DROP CONSTRAINT [FK_FactFootballTeamScore_dates]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] DROP CONSTRAINT [FK_FactFootballTeamScore_football_location]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] DROP CONSTRAINT [FK_FactFootballTeamScore_home_team]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] DROP CONSTRAINT [FK_FactFootballTeamScore_away_team]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] DROP CONSTRAINT [FK_FactFootballTeamScore_football_tournament]
GO
TRUNCATE TABLE [dbo].[dates];
TRUNCATE TABLE [dbo].[FactFootballTeamScore];
TRUNCATE TABLE [dbo].[football_location];
TRUNCATE TABLE [dbo].[football_hometeam];
TRUNCATE TABLE [dbo].[football_awayteam];
TRUNCATE TABLE [dbo].[football_tournament];
GO
ALTER TABLE [dbo].[FactFootballTeamScore] WITH CHECK ADD CONSTRAINT [FK_FactFootballTeamScore_dates] FOREIGN KEY
([date_id])
REFERENCES [dbo].[dates] ([date_id])
GO
ALTER TABLE [dbo].[FactFootballTeamScore] CHECK CONSTRAINT [FK_FactFootballTeamScore_dates]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] WITH CHECK ADD CONSTRAINT [FK_FactFootballTeamScore_football_location] FOREIGN KEY
([football_location_id])
REFERENCES [dbo].[football_location] ([football_location_id])
GO
ALTER TABLE [dbo].[FactFootballTeamScore] CHECK CONSTRAINT [FK_FactFootballTeamScore_football_location]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] WITH CHECK ADD CONSTRAINT [FK_FactFootballTeamScore_football_tournament] FOREIGN KEY
([football_tournament_id])
REFERENCES [dbo].[football_tournament]([football_tournament_id])
GO
ALTER TABLE [dbo].[FactFootballTeamScore] CHECK CONSTRAINT [FK_FactFootballTeamScore_football_tournament]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] WITH CHECK ADD CONSTRAINT [FK_FactFootballTeamScore_home_team] FOREIGN KEY
([home_team_id])
REFERENCES [dbo].[football_hometeam] ([football_hometeam_id])
GO
ALTER TABLE [dbo].[FactFootballTeamScore] CHECK CONSTRAINT [FK_FactFootballTeamScore_home_team]
GO
ALTER TABLE [dbo].[FactFootballTeamScore] WITH CHECK ADD CONSTRAINT [FK_FactFootballTeamScore_away_team] FOREIGN KEY
([away_team_id])
REFERENCES [dbo].[football_awayteam] ([football_awayteam_id])
GO
ALTER TABLE [dbo].[FactFootballTeamScore] CHECK CONSTRAINT [FK_FactFootballTeamScore_away_team]
GO