Tag: tips

Using NOT operator to inverse the condition in SQL Server

Imagine a scenario where you want to retreive records that you dont want. You can use the NOT operator to reverse the search condition. For example , You want to get all the departments having the GroupName other than ‘Research and Development’. The other way of getting the same result is using the != in every condition.

How to Generate C# class from a XML file ?

Do you want to generate C# class from an XML file ?. You can use the xsd tool to do it. How to Generate C# class from a XML file ? 1. Just launch the Visual Studio Developer Command prompt from the Windows Start menu. 2. Type the command xsd and specify the path of the xml file. xsd d:\test\test.xml 3. This will create the…

How to Declare a variable in SQL Server ?

You will most likely declare a variable in the SQL Server and use it in the SQL Statements. You can use the DECLARE statement and specify the variable and datatype and optionally provide a default value. For example , You can declare an NewEmployeeJobTitle variable using the DECLARE statement and provide a default value as ‘Chief Executive Officer’ DECLARE @NewEmployeeJobTitle nvarchar(50) = ‘Chief Executive Officer’;…

How to find if the Column Exists in a table in SQL Server?

If you are looking to find if the column exists in a table in SQL Server, here’s a simple query to it. Assume that the table name is “Articles” and the column name is “AbundantCodeType”, below is a sample query to know if the column exists in SQL Server. How to find if the Column Exists in a table in SQL Server ?

How to sort an array in Java ?

If you want to sort an array in Java , you can use the Arrays.sort utility method to do it. How to sort an array in Java ? Below is a sample code snippet demonstrating the usage of the Arrays.sort utility method to sort an array in java.

How to Open Network Connections from Command line in Windows 10 ?

You can use the ncpa.cpl command to open the network connections from command line in Windows 10. How to Open Network Connections from Command line in Windows 10 ? Just open the command window and type ncpa.cpl and press the enter key to open the network connections dialog. Alternatively , the ncpa.cpl command can also be used in the Run window. Press Windows + R…

How to Check if a login exists in SQL Server ?

If you need to check if a login exists in SQL Server , you can use query the master.dbo.syslogins for it. How to Check if a login exists in SQL Server ? Here’s a sample query demonstrating how you can query master.dbo.syslogins to find out if the login exists in SQL Server. This would retreive all the details of the loginid ‘sa’.

How to change positive numbers to negative in Microsoft Excel 2016 ?

Do you want to change the positive numbers to negative numbers and vice versa (or in simple terms) , reverse the sign of the numbers in Microsoft Excel 2016 ?. This blog post will provide you a simple tip on how to do it using the Paste special function. How to change positive numbers to negative in Microsoft Excel 2016 ? 1. Type the number…

Using BETWEEN clause to specify range of values in SQL Query

In SQL Server 2014 , you can use the BETWEEN clause to specify a range of values in the search criteria. How to specify a range of values in a Query in SQL Server ? For example , you want to to query the Employee table to display the employees having the birthdate between 1969-01-29 and 1975-12-01′ , you can use the BETWEEN clause as…

Connecting to a Database in SQL Server Management Studio

Most of the time you will be connecting to your database when working in SQL Server Management Studio. You want to know how to connect to a particular database in SQL Management Studio when working with SQL Server 2014 and executing a query. For example , you want to connect to the AdventureWorks2014 database. How to connect to a database in SQL Management Studio in…

How to sort an array using Comparator in C# ?

The Array.Sort method lets the developers pass the comparator which can be used to sort an array of objects. How to sort an array using Comparator in C# ? In the below example , the method CompareByName is used which lets the Array.Sort method to sort the array of objects in descending order.

How to hide virtual keyboard in android using Java?

There are times when you want to hide the virtual keyboard in android. You can easily do that using the InputMethodManager. How to hide virtual keyboard in android using Java ? Just call the hideSoftInputFromWindow method of the InputMethodManager class by passing the token of the current window that contains the focussed view. Below is a sample code snippet demonstrating the usage of InputMethodManager to…