Skip to main content

CODING

SQL Server - Insert Multiple Rows

In SQL Server 2005 and earlier versions, you had to execute 3 different INSERT statements in order to insert 3 rows into a table.

{mobile_block=responsive_ad_728_90}

For example:

Entity Framework - How to Use DateTime in ESQL Query

If you've used Entity Framework in your software project you've might encounter the following error when you've tried to use datetime in ESQL query:

"The argument types 'Edm.DateTime' and 'Edm.String' are incompatible for this operation."

As we described using literals in Entity Framework ESQL in our article here, the solution for this error is to convert datetime/string to Entity Framework DateTime literal.

{mobile_block=responsive_ad_2_300_250}

SQL - Find Duplicate Records

The article describes how to find duplicate records in a table with SQL. 

General syntax for the SQL query for finding duplicated rows in a table is:

SELECT [field_name], COUNT([field_name])
FROM [table_name]
GROUP BY [field_name]
HAVING (COUNT([field_name]) > 1)

For example, if we want to find duplicate records with SQL in Students table based on a student's name we could use:

Entity Framework - ESQL Literals

This article describes Entity SQL support for literals.

{mobile_block=responsive_ad_728_90}

Null

The null literal is used to represent the value null for any type. A null literal is compatible with any type.
Typed nulls can be created by a cast over a null literal. For more information, see CAST.
For rules about where free floating null literals can be used, see Null Literals and Type Inference.

Boolean

Boolean literals are represented by the keywords true and false.

PHP - How to Get User IP Address

We share with you the useful PHP function for getting user's IP address you could use in your projects.

The easiest way for obtaining visitor's IP address is using the code line:

{mobile_block=responsive_ad_728_90}

<?php
 
echo $_SERVER["REMOTE_ADDR"]
 
?>

However, if the user is located behind a proxy server, the code may not work, so you can use our function: