Skip to main content
Tweeted twitter.com/#!/StackDBAs/status/638810164263563264
deleted 6534 characters in body
Source Link
Zoinky
  • 359
  • 1
  • 3
  • 17

UPDATE:

CREATE TABLE [AdvertisingExpenses](
[AdvertisingExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[MediaOutletId] [int] NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL);

CREATE TABLE [EventRegistrations](
[EventRegistrationId] [int]  NOT NULL,
[UniqueId] [uniqueidentifier] NOT NULL,
[EventLocationId] [int] NOT NULL,
[PartyId] [int] NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[UserStatusId] [int] NOT NULL,
[WithdrawalDate] [datetime] NULL,
[OverrideSubmissionDate] [datetime] NULL,
[RegistrationStatusId] [int] NULL,
[PersonalExpenseCounter] [int] NULL,
[CompanyExpenseCounter] [int] NULL,
[ManagersUserID] [int] NULL)
CREATE TABLE [GoodsSuppliedExpenses](
[GoodsSuppliedExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

CREATE TABLE [HirePremisesExpenses](
[HirePremisesExpensesId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](255) NOT NULL,
[PurposeOfUse] [varchar](255) NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [PettyExpenses](
[PettyExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[AuthorizedPurchaserId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[ExpenseVendorId] [int] NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [ServiceExpenses](
[ServiceExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfWork] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [TravelHireVehicleExpenses](
[TravelHireVehicleExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfClaim] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim1] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4915, N'b1fc8d66-5906-4351-8d4e-312dfabd4a3f', 62, 3, N'43AC6D89-C764-7510-8281-AD066DC0C5E3', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4916, N'b3d5e9f0-bc50-4b9f-9a73-b0c931c48712', 62, 1, N'21597361-3418-FC34-59EB-E3891178BA83', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4917, N'ece57f63-d6e6-47a5-8a1d-22689f61b05c', 62, 5, N'71D0D677-003F-B671-2A6A-E1F18409F9AC', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4918, N'7e97a007-449d-48ce-89dc-7febc6dbe506', 63, 3, N'581B38F9-9C3B-68F0-4919-4D404B397B3E', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO

DB Schema and Inserts

Using SQL Server 2014 Standard I changed the db schema/inserts to a file (to large for here) which has more inserts as well as uploaded execution plan and results (2 images go side by side to show all returned columns)

execution plan

results 1

results continued

CREATE TABLE [AdvertisingExpenses](
[AdvertisingExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[MediaOutletId] [int] NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL);

CREATE TABLE [EventRegistrations](
[EventRegistrationId] [int]  NOT NULL,
[UniqueId] [uniqueidentifier] NOT NULL,
[EventLocationId] [int] NOT NULL,
[PartyId] [int] NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[UserStatusId] [int] NOT NULL,
[WithdrawalDate] [datetime] NULL,
[OverrideSubmissionDate] [datetime] NULL,
[RegistrationStatusId] [int] NULL,
[PersonalExpenseCounter] [int] NULL,
[CompanyExpenseCounter] [int] NULL,
[ManagersUserID] [int] NULL)
CREATE TABLE [GoodsSuppliedExpenses](
[GoodsSuppliedExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

CREATE TABLE [HirePremisesExpenses](
[HirePremisesExpensesId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](255) NOT NULL,
[PurposeOfUse] [varchar](255) NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [PettyExpenses](
[PettyExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[AuthorizedPurchaserId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[ExpenseVendorId] [int] NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [ServiceExpenses](
[ServiceExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfWork] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [TravelHireVehicleExpenses](
[TravelHireVehicleExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfClaim] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim1] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4915, N'b1fc8d66-5906-4351-8d4e-312dfabd4a3f', 62, 3, N'43AC6D89-C764-7510-8281-AD066DC0C5E3', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4916, N'b3d5e9f0-bc50-4b9f-9a73-b0c931c48712', 62, 1, N'21597361-3418-FC34-59EB-E3891178BA83', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4917, N'ece57f63-d6e6-47a5-8a1d-22689f61b05c', 62, 5, N'71D0D677-003F-B671-2A6A-E1F18409F9AC', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4918, N'7e97a007-449d-48ce-89dc-7febc6dbe506', 63, 3, N'581B38F9-9C3B-68F0-4919-4D404B397B3E', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO

UPDATE:

DB Schema and Inserts

Using SQL Server 2014 Standard I changed the db schema/inserts to a file (to large for here) which has more inserts as well as uploaded execution plan and results (2 images go side by side to show all returned columns)

execution plan

results 1

results continued

put the final `GO` into the parent code block.
Source Link

We have 12 types of expenses in our database, some have fairly differing data minus the Amount fields. We have multiple places in the application and reports that require single and multiple expense totals and counts per expense Type and Grand totals. In the end, wewe want one View for all of these calls but are open to PROCsusing a stored procedure.

CREATE TABLE [AdvertisingExpenses](
[AdvertisingExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[MediaOutletId] [int] NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL);

CREATE TABLE [EventRegistrations](
[EventRegistrationId] [int]  NOT NULL,
[UniqueId] [uniqueidentifier] NOT NULL,
[EventLocationId] [int] NOT NULL,
[PartyId] [int] NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[UserStatusId] [int] NOT NULL,
[WithdrawalDate] [datetime] NULL,
[OverrideSubmissionDate] [datetime] NULL,
[RegistrationStatusId] [int] NULL,
[PersonalExpenseCounter] [int] NULL,
[CompanyExpenseCounter] [int] NULL,
[ManagersUserID] [int] NULL)
CREATE TABLE [GoodsSuppliedExpenses](
[GoodsSuppliedExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

CREATE TABLE [HirePremisesExpenses](
[HirePremisesExpensesId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](255) NOT NULL,
[PurposeOfUse] [varchar](255) NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [PettyExpenses](
[PettyExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[AuthorizedPurchaserId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[ExpenseVendorId] [int] NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [ServiceExpenses](
[ServiceExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfWork] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [TravelHireVehicleExpenses](
[TravelHireVehicleExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfClaim] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim1] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4915, N'b1fc8d66-5906-4351-8d4e-312dfabd4a3f', 62, 3, N'43AC6D89-C764-7510-8281-AD066DC0C5E3', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4916, N'b3d5e9f0-bc50-4b9f-9a73-b0c931c48712', 62, 1, N'21597361-3418-FC34-59EB-E3891178BA83', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4917, N'ece57f63-d6e6-47a5-8a1d-22689f61b05c', 62, 5, N'71D0D677-003F-B671-2A6A-E1F18409F9AC', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4918, N'7e97a007-449d-48ce-89dc-7febc6dbe506', 63, 3, N'581B38F9-9C3B-68F0-4919-4D404B397B3E', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO

GO

We have 12 types of expenses in our database, some have fairly differing data minus the Amount fields. We have multiple places in the application and reports that require single and multiple expense totals and counts per expense Type and Grand totals. In the end, we want one View for all of these calls but are open to PROCs.

CREATE TABLE [AdvertisingExpenses](
[AdvertisingExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[MediaOutletId] [int] NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL);

CREATE TABLE [EventRegistrations](
[EventRegistrationId] [int]  NOT NULL,
[UniqueId] [uniqueidentifier] NOT NULL,
[EventLocationId] [int] NOT NULL,
[PartyId] [int] NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[UserStatusId] [int] NOT NULL,
[WithdrawalDate] [datetime] NULL,
[OverrideSubmissionDate] [datetime] NULL,
[RegistrationStatusId] [int] NULL,
[PersonalExpenseCounter] [int] NULL,
[CompanyExpenseCounter] [int] NULL,
[ManagersUserID] [int] NULL)
CREATE TABLE [GoodsSuppliedExpenses](
[GoodsSuppliedExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

CREATE TABLE [HirePremisesExpenses](
[HirePremisesExpensesId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](255) NOT NULL,
[PurposeOfUse] [varchar](255) NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [PettyExpenses](
[PettyExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[AuthorizedPurchaserId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[ExpenseVendorId] [int] NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [ServiceExpenses](
[ServiceExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfWork] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [TravelHireVehicleExpenses](
[TravelHireVehicleExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfClaim] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim1] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4915, N'b1fc8d66-5906-4351-8d4e-312dfabd4a3f', 62, 3, N'43AC6D89-C764-7510-8281-AD066DC0C5E3', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4916, N'b3d5e9f0-bc50-4b9f-9a73-b0c931c48712', 62, 1, N'21597361-3418-FC34-59EB-E3891178BA83', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4917, N'ece57f63-d6e6-47a5-8a1d-22689f61b05c', 62, 5, N'71D0D677-003F-B671-2A6A-E1F18409F9AC', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4918, N'7e97a007-449d-48ce-89dc-7febc6dbe506', 63, 3, N'581B38F9-9C3B-68F0-4919-4D404B397B3E', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)

GO

We have 12 types of expenses in our database, some have fairly differing data minus the Amount fields. We have multiple places in the application and reports that require single and multiple expense totals and counts per expense Type and Grand totals. In the end, we want one View for all of these calls but are open to using a stored procedure.

CREATE TABLE [AdvertisingExpenses](
[AdvertisingExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[MediaOutletId] [int] NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL);

CREATE TABLE [EventRegistrations](
[EventRegistrationId] [int]  NOT NULL,
[UniqueId] [uniqueidentifier] NOT NULL,
[EventLocationId] [int] NOT NULL,
[PartyId] [int] NOT NULL,
[UserId] [nvarchar](128) NOT NULL,
[UserStatusId] [int] NOT NULL,
[WithdrawalDate] [datetime] NULL,
[OverrideSubmissionDate] [datetime] NULL,
[RegistrationStatusId] [int] NULL,
[PersonalExpenseCounter] [int] NULL,
[CompanyExpenseCounter] [int] NULL,
[ManagersUserID] [int] NULL)
CREATE TABLE [GoodsSuppliedExpenses](
[GoodsSuppliedExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

CREATE TABLE [HirePremisesExpenses](
[HirePremisesExpensesId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[Description] [varchar](255) NOT NULL,
[PurposeOfUse] [varchar](255) NOT NULL,
[PeriodStartDate] [datetime] NOT NULL,
[PeriodEndDate] [datetime] NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [PettyExpenses](
[PettyExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[AuthorizedPurchaserId] [int] NOT NULL,
[Description] [varchar](max) NOT NULL,
[ExpenseVendorId] [int] NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [ServiceExpenses](
[ServiceExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfWork] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)
CREATE TABLE [TravelHireVehicleExpenses](
[TravelHireVehicleExpenseId] [int] NOT NULL,
[EventRegistrationId] [int] NOT NULL,
[FundingAccountId] [int] NULL,
[ExpenseNumber] [int] NOT NULL,
[ExpenseVendorId] [int] NOT NULL,
[NatureOfClaim] [varchar](255) NOT NULL,
[AmountPaid] [decimal](12, 2) NOT NULL,
[CommercialValueAmount] [decimal](12, 2) NOT NULL,
[PurchaseDate] [datetime] NOT NULL,
[ExpenseTypeId] [int] NOT NULL,
[IsJointAgreement] [bit] NOT NULL,
[IfPaidDateOfDirection] [datetime] NULL,
[IsDisputed] [bit] NOT NULL,
[IsUndisputed] [bit] NOT NULL,
[AmountClaimed] [decimal](12, 2) NULL,
[NatureOfClaim1] [varchar](255) NULL,
[InvoiceReceivedDate] [datetime] NULL,
[IsPaid] [bit] NOT NULL,
[Timestamp] [datetime] NOT NULL)

GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4915, N'b1fc8d66-5906-4351-8d4e-312dfabd4a3f', 62, 3, N'43AC6D89-C764-7510-8281-AD066DC0C5E3', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4916, N'b3d5e9f0-bc50-4b9f-9a73-b0c931c48712', 62, 1, N'21597361-3418-FC34-59EB-E3891178BA83', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4917, N'ece57f63-d6e6-47a5-8a1d-22689f61b05c', 62, 5, N'71D0D677-003F-B671-2A6A-E1F18409F9AC', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
INSERT [EventRegistrations] ([EventRegistrationId], [UniqueId], [EventLocationId], [PartyId], [UserId], [UserStatusId], [WithdrawalDate], [OverrideSubmissionDate],  [RegistrationStatusId], [PersonalExpenseCounter], [CompanyExpenseCounter], [ManagersUserID]) VALUES (4918, N'7e97a007-449d-48ce-89dc-7febc6dbe506', 63, 3, N'581B38F9-9C3B-68F0-4919-4D404B397B3E', 1, CAST(N'9999-12-31 00:00:00.000' AS DateTime), CAST(N'9999-12-31 00:00:00.000' AS DateTime), 1, 0, 0, NULL)
GO
Source Link
Zoinky
  • 359
  • 1
  • 3
  • 17
Loading