# SQL Server support

**URL:** <https://community.tempest.earth/t/sql-server-support/282>\
**Category:** Developers\
**Created:** [January 27, 2018, 5:54pm UTC](https://community.tempest.earth/t/sql-server-support/282 "2018-01-27T17:54:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [January 27, 2018, 5:54pm UTC](https://community.tempest.earth/t/sql-server-support/282/1 "2018-01-27T17:54:42Z")

</div>

Has anyone developed a method to copy the WeatherFlow output to a MS SQL Server?

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [January 27, 2018, 6:00pm UTC](https://community.tempest.earth/t/sql-server-support/282/2 "2018-01-27T18:00:00Z")

</div>

Some here have done so using PHP to subscribe via a web socket then inserting the data into the SQL engine.

If your SQL server is local you can use UDP data from the Hub. Otherwise the socket data from the Hub is that same format.

---

<div class="post-metadata">

**Author:** ![eric](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/eric/32/13553_2.png) [@eric](https://community.tempest.earth/u/eric)\
**Post date:** [January 27, 2018, 6:01pm UTC](https://community.tempest.earth/t/sql-server-support/282/3 "2018-01-27T18:01:52Z")

</div>

Locally or remote ?

You can intercept locally the udp stream and use several methods like [Weather Display](http://www.weather-display.com/index.php) (Win/Mac/Nix) [WeeWx](http://weewx.com) …and from there send to mysql locally or why not online like [meteotemplate](http://www.meteotemplate.com/web/index.php)

You can also go the other way round and use the api to go grab the data and store it to mysql but that’s more a coders adventure

---

<div class="post-metadata">

**Author:** ![Weather34](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather34/32/9316_2.png) [@Weather34](https://community.tempest.earth/u/Weather34)\
**Post date:** [January 27, 2018, 6:10pm UTC](https://community.tempest.earth/t/sql-server-support/282/4 "2018-01-27T18:10:26Z")

</div>

hello its quite easy you call the weather API and simply insert into mysql with simple php INSERT INTO

example is in use here at [https://weather34.com](https://weather34.com) i dump the lightning and UV/SOLAR data to mysql alongside my existing weather station data

alternatively you can use software like weather display and build your own mysql database and use the data in any template and pull the data directly from the mysql .

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [January 27, 2018, 6:18pm UTC](https://community.tempest.earth/t/sql-server-support/282/5 "2018-01-27T18:18:36Z")

</div>

I had thought about Weather Display and installed a second copy in a different directory, and if records my data. My problem seems to be with WeatherDisplay’s WDMSSQL app. Seems you cannot run 2 separate versions. Or at least I have not be successful in doing it. I have been successfully running the WDMSSQL app to write my VantagePro data to my SQL Server database.

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [January 27, 2018, 6:19pm UTC](https://community.tempest.earth/t/sql-server-support/282/6 "2018-01-27T18:19:56Z")

</div>

I use the Developer version of MS SQL Server (it is free)

---

<div class="post-metadata">

**Author:** ![Weather34](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather34/32/9316_2.png) [@Weather34](https://community.tempest.earth/u/Weather34)\
**Post date:** [January 27, 2018, 6:20pm UTC](https://community.tempest.earth/t/sql-server-support/282/7 "2018-01-27T18:20:25Z")

</div>

You’re half way there just hook up to the Weatherflow api and n simply insert the json output into the MySQL .

---

<div class="post-metadata">

**Author:** ![vreihen](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/vreihen/32/13217_2.png) [@vreihen](https://community.tempest.earth/u/vreihen)\
**Post date:** [January 27, 2018, 7:21pm UTC](https://community.tempest.earth/t/sql-server-support/282/8 "2018-01-27T19:21:55Z")

</div>

The OP wants to use Microsoft SQL, not MySQL. If your PC is sitting on the same IP subnet as the WF Hub, there are plenty of sample C# to pick the UDP broadcast packets directly off of the network where you can then poke them into an MS-SQL table. Doesn’t seem like more than a few hours to code, but then again I’m not a Windows or C# programmer… 🙂

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [January 27, 2018, 7:29pm UTC](https://community.tempest.earth/t/sql-server-support/282/9 "2018-01-27T19:29:36Z")

</div>

> [@vreihen](#):
>
> The OP wants to use Microsoft SQL, not MySQL

For what he wants to do the both operate the same.

---

<div class="post-metadata">

**Author:** ![Weather34](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather34/32/9316_2.png) [@Weather34](https://community.tempest.earth/u/Weather34)\
**Post date:** [January 27, 2018, 7:36pm UTC](https://community.tempest.earth/t/sql-server-support/282/10 "2018-01-27T19:36:28Z")

</div>

Always a solution and it’s pretty simple almost exactly the same if the php\_mssql extension is installed on your server then use the common php methods

// Connect  
$somethingweather= mssql\_connect($host, $user, $pass) or die("Cannot connect

// Database  
$db = mssql\_select

---

<div class="post-metadata">

**Author:** ![weather-display](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather-display/32/989_2.png) [@weather-display](https://community.tempest.earth/u/weather-display)\
**Post date:** [January 28, 2018, 8:43am UTC](https://community.tempest.earth/t/sql-server-support/282/11 "2018-01-28T08:43:22Z")

</div>

make sure when using a second copy of WD you have a 2wd.txt file there  
so then that copy of WD has separate settings from the normal copy

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [February 2, 2018, 5:53pm UTC](https://community.tempest.earth/t/sql-server-support/282/12 "2018-02-02T17:53:51Z")

</div>

I have created a folder wdisplay2 and installed a second copy of WeaterDisplay… Do I need to buy a second license (which I am fine with)?

Additionally can I run a second instance of wdmssql so I can write my WeatherFlow data to a separate MS SQL Server table?

![Untitled%20picture](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex020/uploads/sws/original/1X/3088848b37073beedb44c1ae8d8a088d34c7ac61.png)

---

<div class="post-metadata">

**Author:** ![weather-display](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather-display/32/989_2.png) [@weather-display](https://community.tempest.earth/u/weather-display)\
**Post date:** [February 2, 2018, 6:47pm UTC](https://community.tempest.earth/t/sql-server-support/282/13 "2018-02-02T18:47:05Z")

</div>

just make to sure to have a 2wd.txt file in that second install location  
just email me the new code

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [February 2, 2018, 7:32pm UTC](https://community.tempest.earth/t/sql-server-support/282/14 "2018-02-02T19:32:35Z")

</div>

> [@ordnance1](#):
>
> Additionally can I run a second instance of wdmssql so I can write my WeatherFlow data to a separate MS SQL Server table?

Let me ask, are you wanting to simply duplicate the same data to a separate database?

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [February 2, 2018, 8:02pm UTC](https://community.tempest.earth/t/sql-server-support/282/15 "2018-02-02T20:02:57Z")

</div>

Sounds so bad when you put it that way, but the answer is yes (same database different table). Not for the long term but just to do a more in depth side by side comparison.

But I have been unsuccessful in running 2 copy’s of wdmssql.exe. I can run 2 copies but they do not both write to there respective table.

---

<div class="post-metadata">

**Author:** ![GaryFunk](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/garyfunk/32/5729_2.png) [@GaryFunk](https://community.tempest.earth/u/GaryFunk)\
**Post date:** [February 2, 2018, 8:36pm UTC](https://community.tempest.earth/t/sql-server-support/282/16 "2018-02-02T20:36:51Z")

</div>

> [@ordnance1](#):
>
> Not for the long term but just to do a more in depth side by side comparison.

Ah… So you are doing this to see if the data is the same. I thought you just wanted a duplicate copy of the data.

---

<div class="post-metadata">

**Author:** ![weather-display](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather-display/32/989_2.png) [@weather-display](https://community.tempest.earth/u/weather-display)\
**Post date:** [February 2, 2018, 10:34pm UTC](https://community.tempest.earth/t/sql-server-support/282/17 "2018-02-02T22:34:54Z")

</div>

are you sure you have the 2nd copy of the running wdmssql set to update to a different table name?

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [February 2, 2018, 11:49pm UTC](https://community.tempest.earth/t/sql-server-support/282/18 "2018-02-02T23:49:28Z")

</div>

Yes same database different table

---

<div class="post-metadata">

**Author:** ![weather-display](https://sea2.discourse-cdn.com/flex020/user_avatar/community.tempest.earth/weather-display/32/989_2.png) [@weather-display](https://community.tempest.earth/u/weather-display)\
**Post date:** [February 3, 2018, 1:30am UTC](https://community.tempest.earth/t/sql-server-support/282/19 "2018-02-03T01:30:33Z")

</div>

in the log, it should say  
loaded table  
any error at that point?

---

<div class="post-metadata">

**Author:** ![ordnance1](https://avatars.discourse-cdn.com/v4/letter/o/bbe5ce/32.png) [@ordnance1](https://community.tempest.earth/u/ordnance1)\
**Post date:** [February 22, 2018, 1:42pm UTC](https://community.tempest.earth/t/sql-server-support/282/20 "2018-02-22T13:42:36Z")

</div>

Sorry for not getting back to you for a while. My motherboard died am in the process of getting everything reinstalled and running.
