Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 1.73 KB | None | 0 0
  1. /***********Royi Namir  /  * Time: 16/12/2018 18:14:12*************/
  2.  
  3. USE ma;
  4.  
  5. --select * from tblsubscriptiontype
  6.  
  7.  
  8. --select * from tblSystemParam where name = 'MAX_SAVED_ARTIST_VIP'
  9.  
  10.  
  11. USE ma;
  12.  
  13. IF NOT EXISTS (
  14.        SELECT 1
  15.        FROM   INFORMATION_SCHEMA.columns
  16.        WHERE  COLUMN_NAME = 'SeeMaxDaysBackwardPrice'
  17.               AND TABLE_NAME = 'tblsubscriptiontype'
  18.    )
  19. BEGIN
  20.     ALTER TABLE dbo.tblsubscriptiontype ADD SeeMaxDaysBackwardPrice INT NULL
  21.    
  22.    
  23.     SET IDENTITY_INSERT [dbo].[tblSubscriptionType] ON;
  24. END
  25. GO
  26.  
  27.  
  28.  
  29. IF EXISTS (
  30.        SELECT 1
  31.        FROM   INFORMATION_SCHEMA.columns
  32.        WHERE  COLUMN_NAME = 'SeeMaxDaysBackwardPrice'
  33.               AND TABLE_NAME = 'tblsubscriptiontype'
  34.    )
  35. BEGIN
  36.     BEGIN TRANSACTION
  37.    
  38.     INSERT INTO [dbo].[tblSubscriptionType]
  39.       (
  40.         [IdSubscriptionType],
  41.         [Name],
  42.         [Descr],
  43.         [NoAccessURL],
  44.         [IsVisible],
  45.         [Priority],
  46.         [IsCanSeeAuctionPrices],
  47.         [IsCanSeeUpcomingAuctionPrices],
  48.         [Order],
  49.         [MaxSavedArtistSystemParam],
  50.         [MaxSavedFiltersSystemParam],
  51.         [isGetVenuesAlert],
  52.         [IdMessageTemplateUpgrade],
  53.         [SeeMaxDaysBackwardPrice]
  54.       )
  55.     SELECT 9,
  56.            N'Esseintials',
  57.            N'Esseintials',
  58.            N'/',
  59.            1,
  60.            100,
  61.            1,
  62.            1,
  63.            65,
  64.            'MAX_SAVED_ARTIST_ESSENTIALS',
  65.            NULL,
  66.            1,
  67.            NULL,
  68.            -365
  69.    
  70.    
  71.     COMMIT;
  72.     RAISERROR (
  73.         N'[dbo].[tblSubscriptionType]: Insert Batch: 1.....Done!',
  74.         10,
  75.         1
  76.     )
  77.     WITH NOWAIT;
  78.    
  79.    
  80.     SET IDENTITY_INSERT [dbo].[tblSubscriptionType] OFF;
  81. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement