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.
In SQL Server 2005 and earlier versions, you had to execute 3 different INSERT statements in order to insert 3 rows into a table.
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.
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:
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: