Tag: tricks
Get the date in YYYY-MM-DD format in SQL Server.
You can retreive the date in the YYYY-MM-DD format in SQL Server using the CONVERT method as shown in this code snippet. How to get the date in YYYY-MM-DD format in SQL Server ?
Lambdas Expression for Getter-Only Auto-Properties in C# 6.0
C# 6.0 lets the developers use the lambda expression to implement the getter value of the read-only property . Whenever a lambda expression is found , the C# compiler identifies it as the property with only get method rather than a field. Lambdas Expression for Getter-Only Auto-Properties in C# 6.0 Below is a sample code snippet demonstrating the use of Lambdas Expression for Getter-Only Auto-Properties…
Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
Below is a sample code snippet demonstrating the usage of the “B” to define a ASCII string in F# . This technique is somewhat similar to Encoding.ASCII.GetBytes in F#. Encoding.ASCII.GetBytes in F# for Array of Bytes (Ascii string)
How to Validate an email address using Regular Expression in C# ?
You can validate an email address in C# using regular expressions which provides the developers to play around with different patterns. Below is a code snippet that shows how you can use regular expression to validate an email address in C# . How to Validate an email address using Regular Expression in C# ?
How to remove user from group using command line in Windows 10 ?
You can use the net localgroup command and specify the /delete parameter to remove the user from a group using command line in Windows 10. The format of the command is as shown below. net localgroup <groupname> <username> /delete How to remove user from group using command line in Windows 10 ? 1. Open command prompt from the elevated administrator mode. 2. Enter the command….
Alias Names for Tables in SQL Query
There are times when you write query and end up qualifying the columns references by indicating the table name. For example , In the above query , the Department table is referred in the GroupName and Name column. Instead of mentioning the table table , we could provide a shortname or alias name for the table and use the alias name instead. The full use…
How to specify the Sort order for a Query in SQL Server ?
If you want the sort the records in descending order by more than one column instead of the default ascending order , you can use the DESC or DESCENDING to this. How to specify the Sort order for a Query in SQL Server ? Here’s the query which retrieves the Department records in Descending order by two columns – Name and GroupName.
How to get the Size of all tables in a SQL Server ?
In SQL Server 2014 Management Studio , you can get the size of all tables in a SQL Server from the Object explorer details window. How to get the Size of all tables in a SQL Server ? 1. In SQL Management Studio 2014 , navigate to the Object explorer details screen from View -> Object explorer details menu or by simply pressing the F7…
How to get the list of user names from command prompt in Windows 10 ?
If you want to get the list of users from the command prompt of your Windows 10 local system , you can use the use the command “net user” as shown below. How to get the list of user names from command prompt in Windows 10 ? Open command prompt in Windows 10. Enter the command “net user” and press the enter key. This will…
Inserting a line break in the NVARCHAR data in SQL Server
For inserting the character break in a data of type NVARCHAR in SQL Server , you can use CHAR(13). Inserting a line break in the NVARCHAR data in SQL Server Inserting a line break in the NVARCHAR data in SQL Server
Searching in an Array in JavaScript
If you want to search an array for a value in JavaScript and retrieve the index of the found array element , you can use the Array’s indexOf method. How to search for an element in an array in JavaScript ? When using the indexOf method , if the value is found, it returns the index representing the array element. If the value is not…
#time switch to measure the execution time in F#
If you want to measure the execution time of your F# code , you can use the #time attribute which lets you measure the F# code easily.