Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This can be achieved by gating your batches with the $(IsShadowDeployment) system variable:

Code Block
languagesql
IF '$(IsShadowDeployment)' = 0
	BEGIN
		PRINT N'Creating linked-server object [LinkedServerAlias] because IsShadowDeployment=0...';
		EXEC sp_addlinkedserver @server=N'LinkedServerAlias'
		, @srvproduct=N'sql_server'
		, @provider=N'SQLOLEDB'
		, @datasrc=N'ActualServerName'
	END
ELSE
	BEGIN
		PRINT N'Skipping linked-server object [LinkedServerAlias] creation because IsShadowDeployment=1';
	END
GO

...