Replication – Only SQL Server Enterprise Edition supports compression – how to work around this problem?

After checking this link about the SQL server version, check this one too:

How do you find the version / edition of SQL Server without SSMS installed?

I just got this script to check what it has on the current server:

        TO SELECT
CASE
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY (& quot; productversion & quot;)) as & 8% & # 39; THEN & # 39; SQL2000 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY (& quot; productversion & quot;)) as & # 39; 9% & # 39; THEN & # 39; SQL2005 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY ("productversion")) as "10 .0%" THEN & # 39; SQL2008 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY (& quot; productversion & quot;)) as & quot; 10.5% & quot; THEN & # 39; SQL2008 R2 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY ("productversion")) as "11%" THEN & # 39; SQL2012 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY ("productversion")) as "12%" THEN & # 39; SQL2014 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY (& quot; productversion & quot;)) as & quot; 13% & quot; THEN & # 39; SQL2016 & # 39;
WHEN CONVERT (VARCHAR (128), SERVERPROPERTY (& quot; productversion & quot;)) as & quot; 14% & quot; THEN & # 39; SQL2017 & # 39;
--WHEN CONVERT (VARCHAR (128), SERVERPROPERTY ("productversion")) similar to "15%" THEN & # 39; SQL2019 & # 39;
ELSE # Unknown in April 2019 & # 39;
FIN AS MajorVersion,
SERVERPROPERTY ('productversion') as 'product version',
SERVERPROPERTY (& # 39; productlevel & # 39;) as & # 39; Product Level & # 39;;
SERVERPROPERTY (& # 39; edition & # 39;) as & # 39; Product Edition & # 39;
SERVERPROPERTY (& # 39; buildclrversion & # 39;) as & # 39; CLR Version & # 39;
SERVERPROPERTY ("ranking") as "default ranking",
SERVERPROPERTY ('instanceinstance') as 'Instance',
SERVERPROPERTY ('lcid') as' LCID & # 39;
SERVERPROPERTY ('servername') as 'Server Name',
SERVERPROPERTY ('EditionID') AS 'EditionID'

and used in my index creation script below, after the authoring table:

                                IF object_id (# TEMPDB .. # RADHE_sp_getsubscriptions) is NOT NULL
DROP TABLE #RADHE_sp_getsubscriptions

create the table #RADHE_sp_getsubscriptions (
name of the publisher not NULL,
publisher_db sysname NOT NULL,
sysname NOT NULL
replication_type int,
subscription_type int,
last_updated datetime,
subscriberd_db sysname,
update_mode int,
last_sync_status int,
last_sync_summary nvarchar (4000),
last_sync_time datetime)

IF (SELECT RADHE = CASE WHEN CONVERTING (VARCHAR (128), SERVERPROPERTY (& # 39;)), LIKE & # 39;% Enterprise% & # 39; THEN 1 EXCEPT 0 END) = 1

CREATE INDEX CLUSTERED I_RADHE_sp_getsubscriptions
ON #RADHE_sp_getsubscriptions (publisher, Publisher_db, publication)
WITH (PAD_INDEX = OFF
, FILLFACTOR = 100
, SORT_IN_TEMPDB = ON
, IGNORE_DUP_KEY = OFF
, STATISTICS_NORECOMPUTE = OFF
, ONLINE = OFF
, DATA_COMPRESSION = PAGE
, ALLOW_ROW_LOCKS = ON
, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]

           OTHER

CREATE INDEX CLUSTERED I_RADHE_sp_getsubscriptions
ON #RADHE_sp_getsubscriptions (publisher, Publisher_db, publication)
WITH (PAD_INDEX = OFF
, FILLFACTOR = 100
, SORT_IN_TEMPDB = ON
, IGNORE_DUP_KEY = OFF
, STATISTICS_NORECOMPUTE = OFF
, ONLINE = OFF
, DATA_COMPRESSION = NONE
, ALLOW_ROW_LOCKS = ON
, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]


- check the index creation script
- EXEC SP_COUNT & # 39; TEMPDB .. # RADHE_sp_getsubscriptions & # 39;

--Results:
- SERVER 1 - CREATE INDEX CLUSTERED I_RADHE_sp_getsubscriptions ON [dbo].[#RADHE_sp_getsubscriptions__________________________________________________________________________________________0000000A9250] (  [publisher] ASC [publisher_db] ASC [publication] ASC) WITH (PAD_INDEX = OFF, FILLFACTOR = 100, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, DROP_EXISTING = ON, DATA_COMPRESSION = NONE, ALLOW_ROW_LOCKS [PRIMARY]  GO
- SERVER 2 - CREATE INDEX CLUSTERED I_RADHE_sp_getsubscriptions ON [dbo].[#RADHE_sp_getsubscriptions__________________________________________________________________________________________00000001B274] (  [publisher] ASC [publisher_db] ASC [publication] ASC) WITH (PAD_INDEX = OFF, FILLFACTOR = 100, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, DROP_EXISTING = ON, DATA_COMPRESSION = PAGE, ALLOW_ROW_LOCKS, ON). [PRIMARY]  GO 

and everything works fine now.