<?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 Stream Dataset for local SQL Server Database Query in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/107540#M3754</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to create Power BI Stream Datasets and Push Data from local SQL Server Query Data to that Stream datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Ragu Thangavel&lt;/P&gt;</description>
    <pubDate>Fri, 30 Dec 2016 03:54:55 GMT</pubDate>
    <dc:creator>raguyazhin</dc:creator>
    <dc:date>2016-12-30T03:54:55Z</dc:date>
    <item>
      <title>Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/107540#M3754</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how to create Power BI Stream Datasets and Push Data from local SQL Server Query Data to that Stream datasets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-- Ragu Thangavel&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 03:54:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/107540#M3754</guid>
      <dc:creator>raguyazhin</dc:creator>
      <dc:date>2016-12-30T03:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/107585#M3756</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/19012"&gt;@raguyazhin&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It would require quite some coding skill.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find the API sample to push data to your stream dataset in Power BI service. Then you can query your databases and send data via a http request in any language you master. Eg in this case, I test it in Powershell.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/24716iE93CA0596726E021/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture2.PNG" style="width: 600px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/24719i6EE56769FFC87369/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$SqlServer = 'yourSQLserverName';
$SqlDatabase = 'databaseName';

$SqlConnectionString = 'Data Source={0};Initial Catalog={1};Integrated Security=SSPI' -f $SqlServer, $SqlDatabase;
$SqlQuery = "SELECT * FROM streamData;";

$SqlCommand = New-Object -TypeName System.Data.SqlClient.SqlCommand;
$SqlCommand.CommandText = $SqlQuery;
$SqlConnection = New-Object -TypeName System.Data.SqlClient.SqlConnection -ArgumentList $SqlConnectionString;
$SqlCommand.Connection = $SqlConnection;

$SqlConnection.Open();
$SqlDataReader = $SqlCommand.ExecuteReader();

##you would find your own endpoint in the Power BI service
$endpoint = "https://api.powerbi.com/beta/72f98xxxxxxx011db47/datasets/d685398b-86xxxxx47f95a9b20e4/rows?key=E5sABoNsS3uxxxxcdwr6QVpJSAgOA6juxxxxxvNYRBjtuLfIg%3D%3D"


#Fetch data and write out to files
while ($SqlDataReader.Read()) {
    $payload =  
    @{
    "product" =$SqlDataReader['product']
    "sales" =$SqlDataReader['sales']
    "datetime" =$SqlDataReader['datetime']
    } 
    Invoke-RestMethod -Method Post -Uri "$endpoint" -Body (ConvertTo-Json @($payload))
}


$SqlConnection.Close();
$SqlConnection.Dispose();&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2016 07:49:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/107585#M3756</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2016-12-30T07:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/133437#M4603</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Could you please describe a little bit more&amp;nbsp;your API?&lt;/P&gt;&lt;P&gt;If I have a local MS SQL with ip 10.0.0.1 and db name 'production_db'&lt;BR /&gt;with constantly updated Fact_Produced table, with a two columns DateTime and ProducedKg&lt;/P&gt;&lt;P&gt;than how&amp;nbsp;your query will looks like and should I use some additional MS app to get connection to the my DB?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 07:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/133437#M4603</guid>
      <dc:creator>mrslyfox</dc:creator>
      <dc:date>2017-02-27T07:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/133438#M4604</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Could you please describe a little bit more&amp;nbsp;your API?&lt;/P&gt;&lt;P&gt;If I have a local MS SQL with ip 10.0.0.1 and db name 'production_db'&lt;BR /&gt;with constantly updated Fact_Produced table, with a two columns DateTime and ProducedKg&lt;/P&gt;&lt;P&gt;how&amp;nbsp;your query will looks like and should I use some additional MS app to get connection to the my DB?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2017 07:31:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/133438#M4604</guid>
      <dc:creator>mrslyfox</dc:creator>
      <dc:date>2017-02-27T07:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/137130#M4716</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/22429"&gt;@mrslyfox&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;The sample PowerShell actually retrieves data from&amp;nbsp;SQL Server and send data to the streaming dataset.&lt;/P&gt;
&lt;P&gt;When saying contantly updated, I think you could use a while loop and change the code accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 08:50:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/137130#M4716</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-03-06T08:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/153533#M5189</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp; Is there a tutorial on how to do?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 16:05:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/153533#M5189</guid>
      <dc:creator>blackshep01</dc:creator>
      <dc:date>2017-04-04T16:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/153728#M5201</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/24733"&gt;@blackshep01&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;It is a Powershell script, so if you'd like to learn Powershell, you'll find the tutorial in the Internet everywhere.&lt;/P&gt;
&lt;P&gt;As to this case, the shortcuts can be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://irisclasson.com/2013/10/16/how-do-i-query-a-sql-server-db-using-powershell-and-how-do-i-filter-format-and-output-to-a-file-stupid-question-251-255/" target="_self"&gt;How do I query a SQL Server DB using PowerShell&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/invoke-restmethod" target="_self"&gt;Invoke-RestMethod&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 03:18:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/153728#M5201</guid>
      <dc:creator>Eric_Zhang</dc:creator>
      <dc:date>2017-04-05T03:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/387740#M11516</link>
      <description>&lt;P&gt;Hi Eric,&lt;/P&gt;&lt;P&gt;I Just went through your Ideas, Is it possible to use this case for a Push Dataset instead of a Streaming Dataset?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 02 Apr 2018 07:17:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/387740#M11516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-02T07:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Stream Dataset for local SQL Server Database Query</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/1756029#M28704</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/6971"&gt;@Eric_Zhang&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;I am new to this API with PowerShell. May I know we still need the data gateway if using this method to puch data for BI??&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 02:00:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Stream-Dataset-for-local-SQL-Server-Database-Query/m-p/1756029#M28704</guid>
      <dc:creator>XIOFEN_LIM</dc:creator>
      <dc:date>2021-03-31T02:00:16Z</dc:date>
    </item>
  </channel>
</rss>

