Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.56 KB | None | 0 0
  1. SET ANSI_NULLS ON
  2. GO
  3. SET QUOTED_IDENTIFIER ON
  4. GO
  5. SET ANSI_PADDING ON
  6. GO
  7. CREATE TABLE [dbo].[Accounts](
  8. [AccountId] [int] IDENTITY(1,1) NOT NULL,
  9. [Lastname] [nvarchar](30) NOT NULL,
  10. [Firstname] [nvarchar](20) NOT NULL,
  11. [Phone] [varchar](15) NOT NULL,
  12. [SumTotal] [decimal](9, 1) NOT NULL,
  13. CONSTRAINT [PK_Accounts] PRIMARY KEY CLUSTERED
  14. (
  15. [AccountId] ASC
  16. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  17. ) ON [PRIMARY]
  18.  
  19. GO
  20. SET ANSI_PADDING OFF
  21. GO
  22. /****** Object: Table [dbo].[Calls] Script Date: 12/06/2015 17:47:23 ******/
  23. SET ANSI_NULLS ON
  24. GO
  25. SET QUOTED_IDENTIFIER ON
  26. GO
  27. CREATE TABLE [dbo].[Calls](
  28. [CallId] [int] IDENTITY(1,1) NOT NULL,
  29. [AccountId] [int] NOT NULL,
  30. [CountryId] [int] NOT NULL,
  31. [Duration] [int] NOT NULL,
  32. [Date] [datetime] NOT NULL,
  33. CONSTRAINT [PK_Calls] PRIMARY KEY CLUSTERED
  34. (
  35. [CallId] ASC
  36. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  37. ) ON [PRIMARY]
  38.  
  39. GO
  40. /****** Object: Table [dbo].[Countries] Script Date: 12/06/2015 17:47:23 ******/
  41. SET ANSI_NULLS ON
  42. GO
  43. SET QUOTED_IDENTIFIER ON
  44. GO
  45. CREATE TABLE [dbo].[Countries](
  46. [CountryId] [int] IDENTITY(1,1) NOT NULL,
  47. [Name] [nvarchar](30) NOT NULL,
  48. [Price] [decimal](4, 1) NOT NULL,
  49. CONSTRAINT [PK_Countries] PRIMARY KEY CLUSTERED
  50. (
  51. [CountryId] ASC
  52. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  53. ) ON [PRIMARY]
  54.  
  55. GO
  56. SET IDENTITY_INSERT [dbo].[Accounts] ON
  57.  
  58. GO
  59. INSERT [dbo].[Accounts] ([AccountId], [Lastname], [Firstname], [Phone], [SumTotal]) VALUES (3, N'Ewart', N'Mathew', N'2383590', CAST(54.0 AS Decimal(9, 1)))
  60. GO
  61. INSERT [dbo].[Accounts] ([AccountId], [Lastname], [Firstname], [Phone], [SumTotal]) VALUES (4, N'Marcello', N'Tyrone', N'2591048', CAST(78.0 AS Decimal(9, 1)))
  62. GO
  63. INSERT [dbo].[Accounts] ([AccountId], [Lastname], [Firstname], [Phone], [SumTotal]) VALUES (6, N'Jasmine ', N'Hobson', N'2839247', CAST(43.0 AS Decimal(9, 1)))
  64. GO
  65. INSERT [dbo].[Accounts] ([AccountId], [Lastname], [Firstname], [Phone], [SumTotal]) VALUES (7, N'Hartigan', N'Josef', N'2023349', CAST(239.0 AS Decimal(9, 1)))
  66. GO
  67. INSERT [dbo].[Accounts] ([AccountId], [Lastname], [Firstname], [Phone], [SumTotal]) VALUES (8, N'Balsamo', N'Tessa', N'2671097', CAST(125.0 AS Decimal(9, 1)))
  68. GO
  69. SET IDENTITY_INSERT [dbo].[Accounts] OFF
  70. GO
  71. SET IDENTITY_INSERT [dbo].[Countries] ON
  72.  
  73. GO
  74. INSERT [dbo].[Countries] ([CountryId], [Name], [Price]) VALUES (1, N'Canada', CAST(7.0 AS Decimal(4, 1)))
  75. GO
  76. INSERT [dbo].[Countries] ([CountryId], [Name], [Price]) VALUES (2, N'China', CAST(4.5 AS Decimal(4, 1)))
  77. GO
  78. INSERT [dbo].[Countries] ([CountryId], [Name], [Price]) VALUES (3, N'United Kingdom', CAST(8.0 AS Decimal(4, 1)))
  79. GO
  80. INSERT [dbo].[Countries] ([CountryId], [Name], [Price]) VALUES (4, N'USA', CAST(6.0 AS Decimal(4, 1)))
  81. GO
  82. SET IDENTITY_INSERT [dbo].[Countries] OFF
  83. GO
  84. ALTER TABLE [dbo].[Calls] WITH CHECK ADD CONSTRAINT [FK_Calls_Accounts] FOREIGN KEY([AccountId])
  85. REFERENCES [dbo].[Accounts] ([AccountId])
  86. GO
  87. ALTER TABLE [dbo].[Calls] CHECK CONSTRAINT [FK_Calls_Accounts]
  88. GO
  89. ALTER TABLE [dbo].[Calls] WITH CHECK ADD CONSTRAINT [FK_Calls_Countries] FOREIGN KEY([CountryId])
  90. REFERENCES [dbo].[Countries] ([CountryId])
  91. GO
  92. ALTER TABLE [dbo].[Calls] CHECK CONSTRAINT [FK_Calls_Countries]
  93. GO
  94.  
  95.  
  96. -----------
  97. app.config + configmanager 4
  98. yvela monacemebis chatvirtva
  99. search button for countries using parameter
  100. messagebox
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement