thorpedosg

3hVprf5Z

Aug 6th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. USE ParadisePapers
  2. GO
  3. if not exists(select 1
  4. from sys.indexes
  5. where sys.indexes.object_id = object_id('dbo.ParadisePapersAddresses') and sys.indexes.name = 'IX_ParadisePapersAddresses_n_country_codes_n_node_id')
  6. BEGIN
  7. CREATE NONCLUSTERED INDEX IX_ParadisePapersAddresses_n_country_codes_n_node_id
  8. ON ParadisePapersAddresses(n_country_codes, n_node_id)
  9. END
  10.  
  11. if not exists(select 1
  12. from sys.indexes
  13. where sys.indexes.object_id = object_id('dbo.ParadisePapersEdges') and sys.indexes.name = 'IX_ParadisePapersEdges_node_1_node_2')
  14. BEGIN
  15. CREATE NONCLUSTERED INDEX IX_ParadisePapersEdges_node_1_node_2
  16. ON ParadisePapersEdges(node_1, node_2)
  17. END
  18.  
  19. if not exists(select 1
  20. from sys.indexes
  21. where sys.indexes.object_id = object_id('dbo.ParadisePapersEntities') and sys.indexes.name = 'IX_ParadisePapersEntities_n_node_id_n_jurisdiction')
  22. BEGIN
  23. CREATE NONCLUSTERED INDEX IX_ParadisePapersEntities_n_node_id_n_jurisdiction
  24. ON ParadisePapersEntities(n_node_id, n_jurisdiction)
  25. END
  26.  
  27. if not exists(select 1
  28. from sys.indexes
  29. where sys.indexes.object_id = object_id('dbo.ParadisePapersIntermediaries') and sys.indexes.name = 'IX_ParadisePapersIntermediaries_n_country_codes_n_node_id')
  30. BEGIN
  31. CREATE NONCLUSTERED INDEX IX_ParadisePapersIntermediaries_n_country_codes_n_node_id
  32. ON ParadisePapersIntermediaries(n_country_codes, n_node_id)
  33. END
  34.  
  35. if not exists(select 1
  36. from sys.indexes
  37. where sys.indexes.object_id = object_id('dbo.ParadisePapersOfficers') and sys.indexes.name = 'IX_ParadisePapersOfficers_n_country_codes_n_node_id')
  38. BEGIN
  39. CREATE NONCLUSTERED INDEX IX_ParadisePapersOfficers_n_country_codes_n_node_id
  40. ON ParadisePapersOfficers(n_country_codes, n_node_id)
  41. END
  42.  
  43.  
  44.  
  45. if not exists(select 1
  46. from sys.indexes
  47. where sys.indexes.object_id = object_id('dbo.ParadisePapersOthers') and sys.indexes.name = 'IX_ParadisePapersOthers_n_country_codes_n_node_id')
  48. BEGIN
  49. CREATE NONCLUSTERED INDEX IX_ParadisePapersOthers_n_country_codes_n_node_id
  50. ON ParadisePapersOthers(n_country_codes, n_node_id)
  51. END
  52.  
  53. if not exists(select 1
  54. from sys.indexes
  55. where sys.indexes.object_id = object_id('dbo.CountriesInfo') and sys.indexes.name = 'IX_PCountriesInfo_alpha3')
  56. BEGIN
  57. CREATE NONCLUSTERED INDEX IX_PCountriesInfo_alpha3
  58. ON CountriesInfo([alpha-3])
  59. END
Add Comment
Please, Sign In to add comment