Calculating GeoDistance between two points

In this article, we are going to see how to calculate Geo-distance between two points using SQL server. You can calculate geo distance using spatial types – geography datatype in SQL server. This type represents data in a round-earth coordinate system, You can find out detailed information at Spatial type: Geography The default syntax for to convert Latitude and Longitude into Geography…

Read More

SQL Server Functions

SQL Scalar functions UCASE() – Converts a field to upper case LCASE() – Converts a field to lower case MID() – Extract characters from a text field LEN() – Returns the length of a text field ROUND() – Rounds a numeric field to the number of decimals specified NOW() – Returns the current system date and time FORMAT() –…

Read More

Stored Procedure – with example

What is Stored Procedure? A stored procedure is a prepared SQL code that you can save, so the code can be reused over and over again. So if you have an SQL query that you write over and over again, save it as a stored procedure, and then just call it to execute it. You can also pass parameters…

Read More

SQL – A beginner’s guide

Comments in SQL There are two ways in which you can comment in SQL, i.e. either the Single-Line Comments or the Multi-Line Comments. Single-Line Comments The single line comment starts with two hyphens (–). So, any text mentioned after (–), till the end of a single line will be ignored by the compiler. Multi-Line Comments  The Multi-line comments start with /* and end with */….

Read More

Verified by MonsterInsights