Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

MAINTAIN STATe OF TABLE ON THREE SEPARATE INSTANCES IN THREE SEPARATE DATACENTERS

$
0
0
the idea is we have a table that has available coupon codes from there different locations. I need to select from all three environments and get the top one that has UsedFlag<>1. i then need to set the usedFlag = 1 in all environments. All three locations will be doing the same thing. i was going to use a tran w/ linked server however was curious if anyone had a better way of advice./****** Object: Table [dbo].[CouponCodes] Script Date: 1/26/2015 3:52:01 PM ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOCREATE TABLE [dbo].[CouponCodes]( [CouponCodeID] [BIGINT] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL, [CouponCode] [NVARCHAR](50) NOT NULL, [DealID] [BIGINT] NOT NULL, [UsedFlag] [VARCHAR](5) NOT NULL CONSTRAINT [DF_CouponCodes_UsedFlag] DEFAULT ('False'), CONSTRAINT [PK_CouponCodes] PRIMARY KEY CLUSTERED ( [CouponCodeID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]GOSET ANSI_PADDING OFFGO

Viewing all articles
Browse latest Browse all 3145

Trending Articles