· 6 years ago · Mar 26, 2019, 08:36 PM
1/*
2Deployment script for iHerb_Rewards_New
3
4This code was generated by a tool.
5Changes to this file may cause incorrect behavior and will be lost if
6the code is regenerated.
7*/
8
9GO
10SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
11
12SET NUMERIC_ROUNDABORT OFF;
13
14
15GO
16
17
18GO
19
20GO
21/*
22Detect SQLCMD mode and disable script execution if SQLCMD mode is not supported.
23To re-enable the script after enabling SQLCMD mode, execute the following:
24SET NOEXEC OFF;
25*/
26GO
27IF N'$(__IsSqlCmdEnabled)' NOT LIKE N'True'
28 BEGIN
29 PRINT N'SQLCMD mode must be enabled to successfully execute this script.';
30 SET NOEXEC ON;
31 END
32
33
34GO
35
36GO
37PRINT N'Dropping Permission...';
38
39
40GO
41REVOKE SELECT
42 ON OBJECT::[rewards].[TBL_RewardAdjustment] TO [IHERB\DEVOPSSVC] CASCADE
43 AS [dbo];
44
45
46GO
47PRINT N'Dropping Permission...';
48
49
50GO
51REVOKE SELECT
52 ON OBJECT::[rewards].[TBL_RewardDetail] TO [IHERB\DEVOPSSVC] CASCADE
53 AS [dbo];
54
55
56GO
57PRINT N'Dropping [rewards].[TBL_RewardAdjustment].[IX_TBL_RewardAdjustment_Customerid_OrderNumber]...';
58
59
60GO
61DROP INDEX [IX_TBL_RewardAdjustment_Customerid_OrderNumber]
62 ON [rewards].[TBL_RewardAdjustment];
63
64
65GO
66PRINT N'Dropping [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_)]...';
67
68
69GO
70DROP INDEX [IX_TBL_RewardDetail_)]
71 ON [rewards].[TBL_RewardDetail];
72
73
74GO
75PRINT N'Dropping [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_CampaignId_CustomerId]...';
76
77
78GO
79DROP INDEX [IX_TBL_RewardDetail_CampaignId_CustomerId]
80 ON [rewards].[TBL_RewardDetail];
81
82
83GO
84PRINT N'Dropping [rewards].[TBL_RewardDetail].[ix_TBL_RewardDetail_OrderNumber_includes]...';
85
86
87GO
88DROP INDEX [ix_TBL_RewardDetail_OrderNumber_includes]
89 ON [rewards].[TBL_RewardDetail];
90
91
92GO
93PRINT N'Dropping [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_OrderNumber_RewardUSD]...';
94
95
96GO
97DROP INDEX [IX_TBL_RewardDetail_OrderNumber_RewardUSD]
98 ON [rewards].[TBL_RewardDetail];
99
100
101GO
102PRINT N'Dropping [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_OrderNumber_Status]...';
103
104
105GO
106DROP INDEX [IX_TBL_RewardDetail_OrderNumber_Status]
107 ON [rewards].[TBL_RewardDetail];
108
109
110GO
111PRINT N'Dropping [rewards].[DF_TBL_RewardAdjustment_DateCreated1]...';
112
113
114GO
115ALTER TABLE [rewards].[TBL_RewardAdjustment] DROP CONSTRAINT [DF_TBL_RewardAdjustment_DateCreated1];
116
117
118GO
119PRINT N'Dropping [rewards].[DF_TBL_RewardAdjustment_DateLastChanged1]...';
120
121
122GO
123ALTER TABLE [rewards].[TBL_RewardAdjustment] DROP CONSTRAINT [DF_TBL_RewardAdjustment_DateLastChanged1];
124
125
126GO
127PRINT N'Dropping [rewards].[DF_TBL_RewardDetail_AffiliatePaused_New2]...';
128
129
130GO
131ALTER TABLE [rewards].[TBL_RewardDetail] DROP CONSTRAINT [DF_TBL_RewardDetail_AffiliatePaused_New2];
132
133
134GO
135PRINT N'Dropping [rewards].[DF_RewardDetail_RewardType_New2]...';
136
137
138GO
139ALTER TABLE [rewards].[TBL_RewardDetail] DROP CONSTRAINT [DF_RewardDetail_RewardType_New2];
140
141
142GO
143PRINT N'Dropping [rewards].[DF_TBL_RewardDetail_DestinationCountryCode_New2]...';
144
145
146GO
147ALTER TABLE [rewards].[TBL_RewardDetail] DROP CONSTRAINT [DF_TBL_RewardDetail_DestinationCountryCode_New2];
148
149
150GO
151PRINT N'Dropping [rewards].[DF_RewardDetail_DateCreated_New2]...';
152
153
154GO
155ALTER TABLE [rewards].[TBL_RewardDetail] DROP CONSTRAINT [DF_RewardDetail_DateCreated_New2];
156
157
158GO
159PRINT N'Dropping [rewards].[PK_TBL_Currencies]...';
160
161
162GO
163ALTER TABLE [rewards].[TBL_Currencies] DROP CONSTRAINT [PK_TBL_Currencies];
164
165
166GO
167PRINT N'Altering [rewards]...';
168
169
170GO
171ALTER AUTHORIZATION
172 ON SCHEMA::[rewards]
173 TO [IHERB\cchan];
174
175
176GO
177PRINT N'Starting rebuilding table [rewards].[TBL_RewardAdjustment]...';
178
179
180GO
181BEGIN TRANSACTION;
182
183SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
184
185SET XACT_ABORT ON;
186
187CREATE TABLE [rewards].[tmp_ms_xx_TBL_RewardAdjustment] (
188 [RewardAdjustmentId] INT IDENTITY (1, 1) NOT NULL,
189 [CustomerId] UNIQUEIDENTIFIER NOT NULL,
190 [RewardUSD] MONEY NOT NULL,
191 [CurrencyCode] VARCHAR (3) NOT NULL,
192 [CurrencyRate] FLOAT (53) NOT NULL,
193 [RedemptionMethod] INT NULL,
194 [OrderNumber] INT NULL,
195 [Status] INT NOT NULL,
196 [StatusDate] DATETIME NOT NULL,
197 [TxType] INT NOT NULL,
198 [CustomerReferralCode] VARCHAR (500) NULL,
199 [DateCreated] DATETIME CONSTRAINT [DF_TBL_RewardAdjustment_DateCreated] DEFAULT (getutcdate()) NOT NULL,
200 [DateExpired] DATETIME NULL,
201 [UserLastChanged] VARCHAR (100) NULL,
202 [DateLastChanged] DATETIME CONSTRAINT [DF_TBL_RewardAdjustment_DateLastChanged] DEFAULT (getutcdate()) NOT NULL,
203 [ExpirationId] UNIQUEIDENTIFIER NULL,
204 CONSTRAINT [tmp_ms_xx_constraint_RewardAdjustment_pk1] PRIMARY KEY CLUSTERED ([RewardAdjustmentId] ASC)
205);
206
207IF EXISTS (SELECT TOP 1 1
208 FROM [rewards].[TBL_RewardAdjustment])
209 BEGIN
210 SET IDENTITY_INSERT [rewards].[tmp_ms_xx_TBL_RewardAdjustment] ON;
211 INSERT INTO [rewards].[tmp_ms_xx_TBL_RewardAdjustment] ([RewardAdjustmentId], [CustomerId], [RewardUSD], [CurrencyCode], [CurrencyRate], [RedemptionMethod], [OrderNumber], [Status], [StatusDate], [TxType], [CustomerReferralCode], [DateCreated], [DateExpired], [UserLastChanged], [DateLastChanged])
212 SELECT [RewardAdjustmentId],
213 [CustomerId],
214 [RewardUSD],
215 [CurrencyCode],
216 [CurrencyRate],
217 [RedemptionMethod],
218 [OrderNumber],
219 [Status],
220 [StatusDate],
221 [TxType],
222 [CustomerReferralCode],
223 [DateCreated],
224 [DateExpired],
225 [UserLastChanged],
226 [DateLastChanged]
227 FROM [rewards].[TBL_RewardAdjustment]
228 ORDER BY [RewardAdjustmentId] ASC;
229 SET IDENTITY_INSERT [rewards].[tmp_ms_xx_TBL_RewardAdjustment] OFF;
230 END
231
232DROP TABLE [rewards].[TBL_RewardAdjustment];
233
234EXECUTE sp_rename N'[rewards].[tmp_ms_xx_TBL_RewardAdjustment]', N'TBL_RewardAdjustment';
235
236EXECUTE sp_rename N'[rewards].[tmp_ms_xx_constraint_RewardAdjustment_pk1]', N'RewardAdjustment_pk', N'OBJECT';
237
238COMMIT TRANSACTION;
239
240SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
241
242
243GO
244PRINT N'Creating [rewards].[TBL_RewardAdjustment].[IX_TBL_RewardAdjustment_CustomerId]...';
245
246
247GO
248CREATE NONCLUSTERED INDEX [IX_TBL_RewardAdjustment_CustomerId]
249 ON [rewards].[TBL_RewardAdjustment]([CustomerId] ASC, [Status] ASC);
250
251
252GO
253PRINT N'Creating [rewards].[TBL_RewardAdjustment].[IX_TBL_RewardAdjustment_1]...';
254
255
256GO
257CREATE NONCLUSTERED INDEX [IX_TBL_RewardAdjustment_1]
258 ON [rewards].[TBL_RewardAdjustment]([RewardAdjustmentId] ASC);
259
260
261GO
262PRINT N'Starting rebuilding table [rewards].[TBL_RewardDetail]...';
263
264
265GO
266BEGIN TRANSACTION;
267
268SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
269
270SET XACT_ABORT ON;
271
272CREATE TABLE [rewards].[tmp_ms_xx_TBL_RewardDetail] (
273 [RewardDetailId] INT IDENTITY (1, 1) NOT NULL,
274 [OrderNumber] INT NULL,
275 [ProductId] INT NULL,
276 [AffiliateCustomerId] UNIQUEIDENTIFIER NOT NULL,
277 [IsAffiliatePaused] BIT CONSTRAINT [DF_TBL_RewardDetail_AffiliatePaused] DEFAULT ((0)) NOT NULL,
278 [RewardType] INT CONSTRAINT [DF_RewardDetail_RewardType] DEFAULT ((0)) NOT NULL,
279 [Quantity] INT NULL,
280 [CampaignId] INT NOT NULL,
281 [OrderTotalUSD] MONEY NOT NULL,
282 [LineItemTotalUSD] MONEY NULL,
283 [RewardUSD] MONEY NOT NULL,
284 [Status] INT NOT NULL,
285 [StatusDate] DATETIME NOT NULL,
286 [SegmentDetailId] INT NULL,
287 [AffiliateReferralCode] VARCHAR (500) NOT NULL,
288 [Subcode] VARCHAR (100) NULL,
289 [OrderExt] INT NULL,
290 [CustomerId] UNIQUEIDENTIFIER NOT NULL,
291 [CustomerReferralCode] VARCHAR (20) NULL,
292 [DestinationCountryCode] VARCHAR (50) CONSTRAINT [DF_TBL_RewardDetail_DestinationCountryCode] DEFAULT ('US') NOT NULL,
293 [DateOrdered] DATETIME NOT NULL,
294 [DateCreated] DATETIME CONSTRAINT [DF_RewardDetail_DateCreated] DEFAULT (getutcdate()) NOT NULL,
295 [DateShipped] DATETIME NULL,
296 [DateActivated] DATETIME NULL,
297 [DateExpired] DATETIME NULL,
298 [OrderCountToActivate] INT NULL,
299 [ExpirationId] UNIQUEIDENTIFIER NULL,
300 CONSTRAINT [tmp_ms_xx_constraint_PK_RewardProduct1] PRIMARY KEY CLUSTERED ([RewardDetailId] ASC)
301);
302
303IF EXISTS (SELECT TOP 1 1
304 FROM [rewards].[TBL_RewardDetail])
305 BEGIN
306 SET IDENTITY_INSERT [rewards].[tmp_ms_xx_TBL_RewardDetail] ON;
307 INSERT INTO [rewards].[tmp_ms_xx_TBL_RewardDetail] ([RewardDetailId], [OrderNumber], [ProductId], [AffiliateCustomerId], [IsAffiliatePaused], [RewardType], [Quantity], [CampaignId], [OrderTotalUSD], [LineItemTotalUSD], [RewardUSD], [Status], [StatusDate], [SegmentDetailId], [AffiliateReferralCode], [Subcode], [OrderExt], [CustomerId], [CustomerReferralCode], [DestinationCountryCode], [DateOrdered], [DateCreated], [DateShipped], [DateActivated], [DateExpired], [OrderCountToActivate])
308 SELECT [RewardDetailId],
309 [OrderNumber],
310 [ProductId],
311 [AffiliateCustomerId],
312 [IsAffiliatePaused],
313 [RewardType],
314 [Quantity],
315 [CampaignId],
316 [OrderTotalUSD],
317 [LineItemTotalUSD],
318 [RewardUSD],
319 [Status],
320 [StatusDate],
321 [SegmentDetailId],
322 [AffiliateReferralCode],
323 [Subcode],
324 [OrderExt],
325 [CustomerId],
326 [CustomerReferralCode],
327 [DestinationCountryCode],
328 [DateOrdered],
329 [DateCreated],
330 [DateShipped],
331 [DateActivated],
332 [DateExpired],
333 [OrderCountToActivate]
334 FROM [rewards].[TBL_RewardDetail]
335 ORDER BY [RewardDetailId] ASC;
336 SET IDENTITY_INSERT [rewards].[tmp_ms_xx_TBL_RewardDetail] OFF;
337 END
338
339DROP TABLE [rewards].[TBL_RewardDetail];
340
341EXECUTE sp_rename N'[rewards].[tmp_ms_xx_TBL_RewardDetail]', N'TBL_RewardDetail';
342
343EXECUTE sp_rename N'[rewards].[tmp_ms_xx_constraint_PK_RewardProduct1]', N'PK_RewardProduct', N'OBJECT';
344
345COMMIT TRANSACTION;
346
347SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
348
349
350GO
351PRINT N'Creating [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_OrderProduct]...';
352
353
354GO
355CREATE NONCLUSTERED INDEX [IX_TBL_RewardDetail_OrderProduct]
356 ON [rewards].[TBL_RewardDetail]([OrderNumber] ASC, [ProductId] ASC);
357
358
359GO
360PRINT N'Creating [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_CustomerId]...';
361
362
363GO
364CREATE NONCLUSTERED INDEX [IX_TBL_RewardDetail_CustomerId]
365 ON [rewards].[TBL_RewardDetail]([CustomerId] ASC, [OrderNumber] ASC);
366
367
368GO
369PRINT N'Creating [rewards].[TBL_RewardDetail].[IX_TBL_RewardDetail_AffiliateId]...';
370
371
372GO
373CREATE NONCLUSTERED INDEX [IX_TBL_RewardDetail_AffiliateId]
374 ON [rewards].[TBL_RewardDetail]([AffiliateCustomerId] ASC, [Status] ASC);
375
376
377GO
378PRINT N'Creating [rewards].[TBL_RewardDetail].[aa]...';
379
380
381GO
382CREATE NONCLUSTERED INDEX [aa]
383 ON [rewards].[TBL_RewardDetail]([DateExpired] ASC, [DateActivated] ASC)
384 INCLUDE([Status]);
385
386
387GO
388PRINT N'Refreshing [rewards].[VIW_CustomerAffiliateRewardsValues]...';
389
390
391GO
392EXECUTE sp_refreshsqlmodule N'[rewards].[VIW_CustomerAffiliateRewardsValues]';
393
394
395GO
396PRINT N'Refreshing [rewards].[VIW_Rewards_EarningsReport]...';
397
398
399GO
400EXECUTE sp_refreshsqlmodule N'[rewards].[VIW_Rewards_EarningsReport]';
401
402
403GO
404PRINT N'Refreshing [rewards].[VIW_CustomerOrderProductRewardTotal]...';
405
406
407GO
408EXECUTE sp_refreshsqlmodule N'[rewards].[VIW_CustomerOrderProductRewardTotal]';
409
410
411GO
412PRINT N'Altering [rewards].[spx_RewardAdjustmentUpdate]...';
413
414
415GO
416
417-- =============================================
418-- Author: Chris Chan
419-- Create date: 2018-11-09
420-- Description: Modify a particular row by the id. Called by rewards
421-- =============================================
422ALTER PROCEDURE [rewards].[spx_RewardAdjustmentUpdate]
423 (
424 @RewardAdjustmentId int
425 ,@OrderNumber int =null
426 , @CustomerId uniqueidentifier
427 , @RewardUSD money
428 , @AffiliateReferralCode varchar(20)
429 , @CurrencyCode varchar(3)
430 , @CurrencyRate float
431 , @RedemptionMethod int = null
432 , @Status int
433 , @StatusDate datetime
434 ,@DateExpired datetime = null
435 , @TxType int
436 , @ExpirationId uniqueidentifier
437 )
438AS
439BEGIN
440 -- SET NOCOUNT ON added to prevent extra result sets from
441 -- interfering with SELECT statements.
442 SET NOCOUNT ON;
443
444 -- rewardType: 0 = Order level reward
445 -- rewardType: 1 = Product level reward
446 -- set @txtype = case when @txType = 5 then 9 when @txType =7 then 5 when @txtype=6 then 9 else @txtype end
447 -- set @status = case when @status = 10 then 1 when @status =20 then 2 else @status end
448
449 update rewards.TBL_RewardAdjustment
450 set OrderNumber= @OrderNumber
451 ,RewardUSD=round(@RewardUSD,2)
452 , Status=@Status
453 , StatusDate=@StatusDate
454 , CustomerReferralCode=@AffiliateReferralCode
455 , CustomerId=@CustomerId
456 , CurrencyCode=@CurrencyCode
457 ,CurrencyRate=@CurrencyRate
458 ,RedemptionMethod=@RedemptionMethod
459 , DateExpired=@DateExpired
460 ,TxType=@TxType
461 ,ExpirationId=@ExpirationId
462 where RewardAdjustmentId = @RewardAdjustmentId
463
464
465END
466GO
467PRINT N'Altering [rewards].[spx_RewardDetailUpdate]...';
468
469
470GO
471-- =============================================
472-- Author: chris chan
473-- Create date: 20181218
474-- Description: update rewardDetail. Called by rewards
475-- =============================================
476ALTER PROCEDURE [rewards].[spx_RewardDetailUpdate] (
477 @RewardDetailId int
478 ,@CampaignId int
479 ,@RewardType int
480 ,@OrderNumber int = null
481 , @ProductId int = null
482 ,@OrderTotalUSD money
483 ,@LineItemTotalUSD int = null
484 ,@DestinationCountryCode varchar(50)
485 ,@AffiliateCustomerId uniqueidentifier
486 ,@AffiliateReferralCode varchar(500)
487 , @IsAffiliatePaused bit
488 , @Quantity int = null
489 , @RewardUSD money
490 , @Status int
491 , @StatusDate datetime
492 , @OrderExt int = null
493 , @CustomerId uniqueidentifier
494 , @DateOrdered datetime
495 , @DateShipped datetime = null
496 , @DateActivated datetime = null
497 , @DateExpired datetime = null
498 , @ExpirationId uniqueidentifier
499)
500AS
501BEGIN
502
503UPDATE [rewards].[TBL_RewardDetail]
504 SET
505 [CampaignId] = @CampaignId
506 ,[OrderNumber] = @OrderNumber
507 ,[ProductId] = @ProductId
508 ,[RewardType] = @RewardType
509 ,[Quantity] = @Quantity
510 ,[OrderTotalUSD] = @OrderTotalUSD
511 ,[LineItemTotalUSD] = @LineItemTotalUSD
512 ,[AffiliateCustomerId] = @AffiliateCustomerId
513 ,[AffiliateReferralCode] = @AffiliateReferralCode
514 ,[IsAffiliatePaused] = @IsAffiliatePaused
515 ,[RewardUSD] = round(@RewardUSD,2)
516 ,[Status] = @Status
517 ,[DestinationCountryCode] = @DestinationCountryCode
518 ,[StatusDate] = @StatusDate
519 ,[OrderExt] = @OrderExt
520 ,[CustomerId] = @CustomerId
521 ,[DateOrdered] = @DateOrdered
522 ,[DateShipped] = @DateShipped
523 ,[DateActivated] = @DateActivated
524 ,[DateExpired] = @DateExpired
525 ,[ExpirationId]=@ExpirationId
526 WHERE RewardDetailId = @RewardDetailId
527
528END
529GO
530PRINT N'Refreshing [rewards].[spx_CancelAllRewardsByAffiliateId]...';
531
532
533GO
534EXECUTE sp_refreshsqlmodule N'[rewards].[spx_CancelAllRewardsByAffiliateId]';
535
536
537GO
538PRINT N'Refreshing [rewards].[spx_GetCustomerRewardAdjustments]...';
539
540
541GO
542EXECUTE sp_refreshsqlmodule N'[rewards].[spx_GetCustomerRewardAdjustments]';
543
544
545GO
546PRINT N'Refreshing [rewards].[spx_GetCustomerRewardLimit]...';
547
548
549GO
550EXECUTE sp_refreshsqlmodule N'[rewards].[spx_GetCustomerRewardLimit]';
551
552
553GO
554PRINT N'Refreshing [rewards].[spx_RewardAdjustmentInsert]...';
555
556
557GO
558EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardAdjustmentInsert]';
559
560
561GO
562PRINT N'Refreshing [rewards].[spx_SetCustomerRewardAdjustmentsExpired]...';
563
564
565GO
566EXECUTE sp_refreshsqlmodule N'[rewards].[spx_SetCustomerRewardAdjustmentsExpired]';
567
568
569GO
570PRINT N'Refreshing [account].[spx_CustomerAvailableRewardUpsert]...';
571
572
573GO
574EXECUTE sp_refreshsqlmodule N'[account].[spx_CustomerAvailableRewardUpsert]';
575
576
577GO
578PRINT N'Refreshing [rewards].[spx_GetAffiliateRewardValues]...';
579
580
581GO
582EXECUTE sp_refreshsqlmodule N'[rewards].[spx_GetAffiliateRewardValues]';
583
584
585GO
586PRINT N'Refreshing [rewards].[spx_CheckOrderNumber]...';
587
588
589GO
590EXECUTE sp_refreshsqlmodule N'[rewards].[spx_CheckOrderNumber]';
591
592
593GO
594PRINT N'Refreshing [rewards].[spx_RewardDetailAffiliatePausedStatus]...';
595
596
597GO
598EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardDetailAffiliatePausedStatus]';
599
600
601GO
602PRINT N'Refreshing [rewards].[spx_RewardDetailInsert]...';
603
604
605GO
606EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardDetailInsert]';
607
608
609GO
610PRINT N'Refreshing [rewards].[spx_RewardDetailOrderCancelled]...';
611
612
613GO
614EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardDetailOrderCancelled]';
615
616
617GO
618PRINT N'Refreshing [rewards].[spx_RewardDetailOrderExtShipped]...';
619
620
621GO
622EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardDetailOrderExtShipped]';
623
624
625GO
626PRINT N'Refreshing [rewards].[spx_RewardDetailReversalInsert]...';
627
628
629GO
630EXECUTE sp_refreshsqlmodule N'[rewards].[spx_RewardDetailReversalInsert]';
631
632
633GO
634PRINT N'Refreshing [rewards].[spx_GetCustomerCampaignByOrder]...';
635
636
637GO
638EXECUTE sp_refreshsqlmodule N'[rewards].[spx_GetCustomerCampaignByOrder]';
639
640
641GO
642PRINT N'Refreshing [rewards].[spx_CancelRewardAdjustmentById]...';
643
644
645GO
646EXECUTE sp_refreshsqlmodule N'[rewards].[spx_CancelRewardAdjustmentById]';
647
648
649GO
650PRINT N'Update complete.';
651
652
653GO