Skip to content

Instantly share code, notes, and snippets.

@MovGP0
Created September 11, 2018 08:04
Show Gist options
  • Select an option

  • Save MovGP0/32fa152fe5a562a22db55acd673e65c3 to your computer and use it in GitHub Desktop.

Select an option

Save MovGP0/32fa152fe5a562a22db55acd673e65c3 to your computer and use it in GitHub Desktop.
SQL Server Environment Variables
USE [master]
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
GO
GRANT EXECUTE ON xp_cmdshell TO [ANPRIN\SVCCareCenter]
GRANT CONTROL SERVER TO [ANPRIN\SVCCareCenter]
GO
-- determine the environment
declare @Url varchar(2083) = 'http://carecenterservice.api.local/assistentfilters/tlstermineeintragen';
declare @environment varchar(50);
declare @table table (value varchar(50));
insert into @table exec master..xp_cmdshell N'echo %ASPNETCORE_ENVIRONMENT%';
set @environment = (select top 1 value from @table);
-- set the url to the service
if @environment = N'Development' OR @environment = N'Staging'
begin
set @Url = 'http://carecenterservicestaging.api.local/assistentfilters/tlstermineeintragen';
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment