112417_1021_Authenticat1.png

SQL Server Edition Upgrade might fail

What happened?

A while back I tasked myself with automating an SQL server edition upgrade using PowerShell.

I ran into some problems. I made sure the upgrade was as /s (silent) as possible and so I only got a very rudimentary progress bar. The upgrade would seem to take a long time and after two hours of waiting I decided that the upgrade had “hung”. I repeated the upgrade but kept a look at the log file.

What was wrong?

Looking into the log file I found that the thing that seemed to hang was this row:

Waiting for nt event ‘Global\sqlserverRecComplete’ to be created

How to solve it?

Searching for it online I found several reasons for this and one (unsupported) option stood out, simply skip the rules-check.

If the upgrade fails in this way, simply add the following to your PowerShell string:

/SkipRules=Engine_SqlEngineHealthCheck

The implications

Some images on Azure has SQL Server evaluation edition installed by default. You usually want to upgrade these to Developer Edition, using the built in Edition Upgrade functionality.

If you run into the “hang” issues you have to upgrade SQL server without checking the rule SQLEngineHealthCheck.

112417_1021_Authenticat1.png

How to only poll data on specific weekdays using the WCF-SQL adapter

There are a lot of solutions to this particular question. The need is that we only poll data from a database on Sundays. This might be solved using a stored procedure that only returns data on Sundays. It might also be solved by using the famous schedule task adapter to schedule the poll for Sundays. You can also do some cool coding thing using a custom pipeline component that rejects data on all other days but Sundays. Your scenario might be very well suited for one of these solutions, the scenario presented by my colleague Henrik Wallenberg did not fit any of those.

The scenario

A database is continuously updated thru out the week but we need the export data from a specific table every Sunday at 6pm. We cannot use the schedule task adapter nor stored procedures. We decided to try to trick BizTalk using the PolledDataAvailableStatement in the WCF-SQL adapter on a receive port. Turns out it works! Here is how.

Please note that this does not work if you cannot use ambient transactions.

According to this post, you must set Use Ambient Transaction = true if you need to us a polledDataAvailableStatement. This seems really odd to me but after receiving feedback about this article I know that it is true.

 

The solution

  1. Create the receive location and polling statement.
  2. Find the setting PolledDataAvailableStatement
  3. Set it to: SELECT CASE WHEN DATEPART(DW, GETDATE()) = 1 THEN 1 ELSE 0 END
  4. Set the polling interval to 3600 (once an hour).
  5. Apply your settings.
  6. Set the Service Window to only enable the receive location between 6pm and 6:30 pm.
  7. Now the receive location will only poll once a day and only execute the polling statement on Sundays.

More information

How does this work? It is very simple really. The property PolledDataAvailableStatement (more info here) needs to return a resultset (aka a SELECT). The top leftmost, first if you will, cell of this resultset must be a number. If a positive number is returned, then the pollingstatement will be executed, otherwise not. The SQL statement uses a SQL built-in function called DATEPART with a parameter value of “dw”, which returns “Day Of Week”. More information here. Day 1 is by default in SQL Server a Sunday, because Americans treat days and dates in a very awkward way. There might be some tweaking to your statement in order to make Sunday the 7th day of the week. So the statement SELECT CASE WHEN DATEPART(DW, GETDATE()) = 1 THEN ‘1’ ELSE ‘0’ END returns a 1 if it is day 1 (Sunday). This means that the pollingstatement will only be executed of Sundays. We then set the pollinginterval to only execute once an hour. This, together with the service window, will make sure the statement only executes once a day (at 6pm) as the receive location is not enabled the next hour (7pm). You could update the SQL statement to take the hour of the day into consideration as well but I think it is better to not even execute the statement.

The downside

This is not a very reliable solution though. What if the database was unavailable that one time during the week when data is transported? Then you have to either wait for next week or manually update the PolledDataAvailableStatement to return a 1, make sure the data is transported and then reset the PolledDataAvailableStatement again.

In conclusion

It is a very particular scenario in which this solution is viable and even then it needs to be checked every week. Perhaps you should consider another solution. Thanks to Henrik for making my idea a reality and testing it out. If you want to test it out for yourself, some resources to help you can be found here: InstallApp Script

112417_1021_Authenticat1.png

Connecting to Wi-Fi without verifying certificate

I love Windows 10! One reason is that it simplifies a lot of things that I do not want to care about. Usually you just click an icon and things just work. There is a downside to this though: Sometimes you want to access the “advanced properties” and that can be tricky. This is a reminder article for me (and perhaps someone else) how you can alter settings for a wireless network connection in Windows 10.

The problem

The thing was this: I just returned back to the office after spending about 18 months at client. I wanted to connect my computer to the “BYOD-network” at the office. So I just clicked the icon but got an error message, the not very informative “cannot connect to network”. So this time I needed to access the advanced options, but in Windows 10 you cannot access those simply by right-clicking.

If you try to right-click any of the icons nothing happens, so you cannot get or change any information about the Wi-Fi access point. So I did not even know what was wrong. I did remember being able to connect my phone to the network, so I tried that, and I got it to work by not verifying the server certificate. So all I needed to do is to make Windows do the same. This, as it turns out, is not easy.

The solution

Basically I needed to manually create a connection to the Wi-Fi network. To do this, there are some steps. Looking at the overview you need to:

  1. Delete the existing connection from the Windows “known connections”.
  2. Create a connection to the wireless network manually, adding settings as you go.
  3. Updating credentials.

Delete connection

I tried to connect to the wireless network the usual way. When I did the network got added to the “Known Networks” even if I failed to connect. In order to add it manually you need to remove it first. This might not apply to you but make sure it is not in the known networks list.

  1. Open the Wi-Fi settings using the icon in the lower right corner and clicking network settings.
  2. Scroll down to “Manage Wi-Fi Settings” and click it.
  3. Scroll down to manage known networks and find the network in question, click it and then click the Forget button.

Manually create the connection

In order to change anything that is not the standard settings, you have to set them yourself.

  1. Open the old control panel
  2. Choose “Network and Internet”.
  3. Choose “Network and Sharing Center”.
  4. Click Setup new connection or network
  5. Choose according to picture and click next:
  6. In the “Network name”-box you have to enter the full name of the network as it was displayed in the network list earlier. This is usually the SSID as well.
  7. The security type can be different from what is shown in the picture. Choose what is most likely for you and click next.
  8. On the next page, choose Change connection settings. If you get a message that the network already exists you must remove it first (see above). It cannot be changed.
  9. The following page appears
  10. Click the Security tab
  11. Click the Settings button indicated by the picture.
  12. Untick the box indicated in the picture, if you need to remove the certificate verification.

    This is the setting that removes the certificate check that I needed. Click OK to close.
  13. Now click advanced settings.
  14. Select to Specify authentication mode and pick the one that applies to you.

    In my case it was “User authentication” as I do not use domain logon credentials. If you do, select the “User or computer authentication”.
  15. If you selected “User Authentication” you can opt to save your credentials now by clicking that button and entering your username and password. Click OK to close.

Update credentials

You have now created a new connection. Simply select it by clicking the wireless icon. If you have configured everything correctly, you can now connect. Perhaps you need to enter your credentials.