Skip to main content

Blog

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.

SQL Server - How to Disable / Enable All Triggers

Working on a software project can be time consuming and it is useful if any task could be shortened or automatized.

If you often work on SQL Server you might come across a requirement to disable or enable all triggers in database.

Here are instructions how you can achiveve that:

Disable all triggers in database

exec sp_msforeachtable @command1 = 'ALTER TABLE [table_name] DISABLE TRIGGER ALL'

Enable all triggers in database

exec sp_msforeachtable @command1 = 'ALTER TABLE [table_name] ENABLE TRIGGER ALL'

How to Recover Windows Boot After Deleting Linux Partitition

Many of you tried dual-booting with Linux and Windows installation and maybe deleted the Linux partition. I'm sure that you still remember pain when you realized that Windows wouldn't boot anymore.

The solution for this situation is to reinstall Windows boot loader. Here is how to fix it:

{mobile_block=responsive_ad_2_300_250}

Recovering boot loader in Windows XP:

1) Boot the system from your Windows XP-CD, just like you booted the Linux-CD/DVD before

2) Start the recovery/repair console (not the repair installation)

3) Type

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: