Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Close Sybase Connection after Refreshing Data or Testing Connection

Hi, each time I refresh my Sybase connection in Power BI Service or test the connection in the Data Gateway settings, Sybase adds a connection or 2 to this database.  Yesterday I had used up all my connections because of this.  Is there a way to close the connection after running my PowerBI query or testing the connection?  Thanks.

Connection Results.JPG

 

declare @Max_trade_date int
select @Max_trade_date =
max(trade_date_id)
from misty_owner.gcis_v_workflow_status
where
is_weekend_flag = 0
and is_holiday_flag = 0
and trade_date_id < Convert(int, Convert(varchar(12),today(), 112))

select
CONVERT(varchar, CONVERT(DATETIME, CONVERT(CHAR(8), trade_date_id)),101) as 'Trade Date'
,status_code as 'Status Code'
,status as 'Status'
,business_name as 'Business Name'
,business_group as 'Business Group'
,business_description as 'Business Description'
,Convert(varchar, completion_time, 101) || ' ' || CONVERT(varchar(15),CAST(completion_time AS TIME),100) as 'Completion Time'
,Convert(varchar, expected_completion_time, 101) || ' ' || CONVERT(varchar(15),CAST(expected_completion_time AS TIME),100) as 'Expected Completion Time'
,is_weekend_flag
,is_holiday_flag
from misty_owner.GCIS_V_workflow_status
where trade_date_id = @Max_trade_date
order by
status_code
,business_name

Status: Needs Info
Comments
v-haibl-msft
Employee

@matco88

 

Maybe you can try with following script to restart the gateway to see if it works.

 

net stop PBIEgwService
Taskkill /IM GWConfig.exe /F
timeout /t 30
net start PBIEgwService
"C:\Users\Administrator\AppData\Local\Power BI Gateway - Personal\2.0\Configurator\GWConfig.exe"
Exit

 

Best Regards,
Herbert

Vicky_Song
Impactful Individual
Status changed to: Needs Info
 
matco88
Regular Visitor

@v-haibl-msft

Where do I run this script?

Thanks,

Matt

v-haibl-msft
Employee

@matco88

 

Run the commands in CMD. You can also create a VBScript to include all above commands in it.

 

Best Regards,
Herbert

matco88
Regular Visitor

Thanks @v-haibl-msft, I will try this out.

Matt