<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Streaming from SQL Server in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Streaming-from-SQL-Server/m-p/800940#M20883</link>
    <description>&lt;P&gt;When ai try run this script, it return error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$SqlServer = 'GRANITOAON';&lt;BR /&gt;$SqlDatabase = 'DWPago';&lt;/P&gt;&lt;P&gt;$SqlConnectionString = 'Data Source={0};Initial Catalog={1};Integrated Security=SSPI' -f $SqlServer, $SqlDatabase;&lt;BR /&gt;$SqlQuery = "select a.QuantidadeTransações as TransacoesMes, a.ValorTransacionado as ValorTransacoesMes, b.QuantidadeTransações as TransacoesDia, b.ValorTransacionado as ValorTransacoesDia, c.Data as Data, c.TransacoesUltimoMin as TransacoesMinuto, c.TempoProcessamentoBD as TempoProcessamentoBD, c.TempoProcessamentoSocket as TempoProcessamentoSocket, c.TempoProcessamentoHSM as TempoProcessamentoHSM from [vw_rt_transacoesmes] a, [vw_rt_transacoesdia] b, [vw_rt_processamentotransacao] c;";&lt;/P&gt;&lt;P&gt;$SqlCommand = New-Object -TypeName System.Data.SqlClient.SqlCommand;&lt;BR /&gt;$SqlCommand.CommandText = $SqlQuery;&lt;BR /&gt;$SqlConnection = New-Object -TypeName System.Data.SqlClient.SqlConnection -ArgumentList $SqlConnectionString;&lt;BR /&gt;$SqlCommand.Connection = $SqlConnection;&lt;/P&gt;&lt;P&gt;$SqlConnection.Open();&lt;BR /&gt;$SqlDataReader = $SqlCommand.ExecuteReader();&lt;/P&gt;&lt;P&gt;##you would find your own endpoint in the Power BI service&lt;BR /&gt;$endpoint = "&lt;A href="https://api.powerbi.com/beta/0c4e7c53-5100-4c56-8aa0-9705f186a05c/datasets/75393a01-8326-41ab-a4aa-c5940578a6eb/rows?key=B7bc9GHRohDwzdPpb23E7YL89tNY%2BEu3Bg267F0InR37VA8lAolvQlT9G7CZVoWAfAtWqkIr9cFQKdYPzMGZCw%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/0c4e7c53-5100-4c56-8aa0-9705f186a05c/datasets/75393a01-8326-41ab-a4aa-c5940578a6eb/rows?key=B7bc9GHRohDwzdPpb23E7YL89tNY%2BEu3Bg267F0InR37VA8lAolvQlT9G7CZVoWAfAtWqkIr9cFQKdYPzMGZCw%3D%3D&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Fetch data and write out to files&lt;BR /&gt;while ($SqlDataReader.Read()) {&lt;BR /&gt;$payload = @{&lt;BR /&gt;"Transações Mês" =$SqlDataReader['TransacoesMes']&lt;BR /&gt;"Valor Transacionado Mês" =$SqlDataReader['ValorTransacoesMes']&lt;BR /&gt;"Transações Dia" =$SqlDataReader['TransacoesDia']&lt;BR /&gt;"Valor Transacionado Dia" =$SqlDataReader['ValorTransacoesDia']&lt;BR /&gt;"Data" =$SqlDataReader['Data']&lt;BR /&gt;"Transações por minuto" =$SqlDataReader['TransacoesMinuto']&lt;BR /&gt;"Tempo Médio Procesamento BD" =$SqlDataReader['TempoProcessamentoBD']&lt;BR /&gt;"Tempo Médio Processamento Socket" =$SqlDataReader['TempoProcessamentoSocket']&lt;BR /&gt;"Tempo Médio Processamento HSM" =$SqlDataReader['TempoProcessamentoHSM']&lt;BR /&gt;}&lt;BR /&gt;Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($payload))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$SqlConnection.Close();&lt;BR /&gt;$SqlConnection.Dispose();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;BR /&gt;At line:33 char:5&lt;BR /&gt;+ Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($paylo ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/P&gt;</description>
    <pubDate>Tue, 24 Sep 2019 15:53:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-09-24T15:53:09Z</dc:date>
    <item>
      <title>Streaming from SQL Server</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Streaming-from-SQL-Server/m-p/800940#M20883</link>
      <description>&lt;P&gt;When ai try run this script, it return error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$SqlServer = 'GRANITOAON';&lt;BR /&gt;$SqlDatabase = 'DWPago';&lt;/P&gt;&lt;P&gt;$SqlConnectionString = 'Data Source={0};Initial Catalog={1};Integrated Security=SSPI' -f $SqlServer, $SqlDatabase;&lt;BR /&gt;$SqlQuery = "select a.QuantidadeTransações as TransacoesMes, a.ValorTransacionado as ValorTransacoesMes, b.QuantidadeTransações as TransacoesDia, b.ValorTransacionado as ValorTransacoesDia, c.Data as Data, c.TransacoesUltimoMin as TransacoesMinuto, c.TempoProcessamentoBD as TempoProcessamentoBD, c.TempoProcessamentoSocket as TempoProcessamentoSocket, c.TempoProcessamentoHSM as TempoProcessamentoHSM from [vw_rt_transacoesmes] a, [vw_rt_transacoesdia] b, [vw_rt_processamentotransacao] c;";&lt;/P&gt;&lt;P&gt;$SqlCommand = New-Object -TypeName System.Data.SqlClient.SqlCommand;&lt;BR /&gt;$SqlCommand.CommandText = $SqlQuery;&lt;BR /&gt;$SqlConnection = New-Object -TypeName System.Data.SqlClient.SqlConnection -ArgumentList $SqlConnectionString;&lt;BR /&gt;$SqlCommand.Connection = $SqlConnection;&lt;/P&gt;&lt;P&gt;$SqlConnection.Open();&lt;BR /&gt;$SqlDataReader = $SqlCommand.ExecuteReader();&lt;/P&gt;&lt;P&gt;##you would find your own endpoint in the Power BI service&lt;BR /&gt;$endpoint = "&lt;A href="https://api.powerbi.com/beta/0c4e7c53-5100-4c56-8aa0-9705f186a05c/datasets/75393a01-8326-41ab-a4aa-c5940578a6eb/rows?key=B7bc9GHRohDwzdPpb23E7YL89tNY%2BEu3Bg267F0InR37VA8lAolvQlT9G7CZVoWAfAtWqkIr9cFQKdYPzMGZCw%3D%3D" target="_blank" rel="noopener"&gt;https://api.powerbi.com/beta/0c4e7c53-5100-4c56-8aa0-9705f186a05c/datasets/75393a01-8326-41ab-a4aa-c5940578a6eb/rows?key=B7bc9GHRohDwzdPpb23E7YL89tNY%2BEu3Bg267F0InR37VA8lAolvQlT9G7CZVoWAfAtWqkIr9cFQKdYPzMGZCw%3D%3D&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;#Fetch data and write out to files&lt;BR /&gt;while ($SqlDataReader.Read()) {&lt;BR /&gt;$payload = @{&lt;BR /&gt;"Transações Mês" =$SqlDataReader['TransacoesMes']&lt;BR /&gt;"Valor Transacionado Mês" =$SqlDataReader['ValorTransacoesMes']&lt;BR /&gt;"Transações Dia" =$SqlDataReader['TransacoesDia']&lt;BR /&gt;"Valor Transacionado Dia" =$SqlDataReader['ValorTransacoesDia']&lt;BR /&gt;"Data" =$SqlDataReader['Data']&lt;BR /&gt;"Transações por minuto" =$SqlDataReader['TransacoesMinuto']&lt;BR /&gt;"Tempo Médio Procesamento BD" =$SqlDataReader['TempoProcessamentoBD']&lt;BR /&gt;"Tempo Médio Processamento Socket" =$SqlDataReader['TempoProcessamentoSocket']&lt;BR /&gt;"Tempo Médio Processamento HSM" =$SqlDataReader['TempoProcessamentoHSM']&lt;BR /&gt;}&lt;BR /&gt;Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($payload))&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$SqlConnection.Close();&lt;BR /&gt;$SqlConnection.Dispose();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;BR /&gt;At line:33 char:5&lt;BR /&gt;+ Invoke-RestMethod -Method Post -Uri $endpoint -Body (ConvertTo-Json @($paylo ...&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand&lt;/P&gt;</description>
      <pubDate>Tue, 24 Sep 2019 15:53:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Streaming-from-SQL-Server/m-p/800940#M20883</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-09-24T15:53:09Z</dc:date>
    </item>
  </channel>
</rss>

