Posts

RDP Issue: The Function requested is not supported

Image
Recently I started facing following error while trying to connect to one of my Windows server using RDP. An authentication error has occurred. The function requested is not supported. This was because of the recent patch related to security "Security Update for Microsoft Windows (KB4093112)" installed on the client but related equivalent patch not installed on server. The server was not patched with updates but the client was and hence the issue. So I uninstalled the patch from the client, then when tried to RDP the server and I was able to. I then patched the server with necessary updates and later applied the updates the client as well.

RaspberryPi headless setup

Hardware requirements: RaspberryPi SD Card (Usually included when you buy RaspberryPi) SD Card Reader (Required if your PC does not have one) WiFi Router to get your RaspberryPi connected to PC (optionally with SD Card Reader) Software requirements: Raspbian SD Card Formatter Win32DiskImager Angry IP Scanner PuTTY VNC Viewer Steps to setup RaspberryPi in headless mode: Format SD Card using SD Card Formatter Copy the OS iso image to SD card using Win32DiskImager Create below files on root folder in SD Card Blank file named "ssh" without any extension in the root folder of SD card "wpa_supplicant.conf" with following lines of code in the root folder of SD card: Make sure to replace the country, ssid and psk values correctly in the above file. Remove the card and insert it into RaspberryPi and boot it up. Run Angry IP Scanner and scan for ip range for ip addresses of WiFi. If your router IP is 192.168.0.1 then scan for the range 192.168.0.0 to 192.168.0...

You must have a user with the same password in master or target server

While creating the build of a SQL server database project you could face following error: Error Deploy72002: Unable to connect to master or target server 'DatabaseName'. You must have a user with the same password in master or target server 'DatabaseName'. This error could be caused by the user account used in publish profile with could have sysadmin privileges. Since sysadmin users on server are mapped with user "dbo" in database hence this error. You can create or use another user with db_owner permission on the database. This could resolve this issue.

Deadlocks of an Azure Database

If your Azure database is experiencing deadlocks or below error Transaction (Process ID) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction then you can see them by executing following query in the master database:

Schema.Object has an unresolved reference to Schema

If while building a database project face this error: Severity Code Description Project File Line Suppression State Error SQL71501: Function: [schema].[object] has an unresolved reference to Schema [schema]. DBProject.Database D:\TFS\path\DBProject.Database\schema\Functions\schema.object.sql Then this error might be because you have object definition referring to the schema under which they are supposed to be created but there is not script to create that schema. Suppose your schema name is empschema then you should add file smpschema.sql to the project with following code: CREATE SCHEMA empschema AUTHORIZATION dbo;

Assigning values to variables from same table but different rows

Image
I often see developers assigning values to variables from the same table but different rows based on the row ID. The values are mostly from the same column. What I see is the table is queries multiple times and could impact performance. Below is the sample query and its execution plan. DECLARE @Method1 nvarchar(50); DECLARE @Method2 nvarchar(50); SET @Method1=(SELECT DeliveryMethodName FROM [Application].[DeliveryMethods] WHERE DeliveryMethodID=1); SET @Method2=(SELECT DeliveryMethodName FROM [Application].[DeliveryMethods] WHERE DeliveryMethodID=2); Instead, we can do it as in below query: This can also be used while fetching values from an XML column or variable based on a node.

Avoiding Dynamic Queries

Mostly we write dynamic queries when we try to write the stored procedure which filters data from the column selected by the user or when the user decides on which column to sort the data or when criteria to filter data are multiple as like or equals or does not equal. Below query will give an idea on how to achieve this without writing a dynamic query.

Make Money from Surveys