Sql Server Some Useful Query

This Query is Used to Create a new table from Existing Table
Select top 0 * into Demo from MaterialMaster

Sql Server Select Into Syntax
SELECT Id, Name INTO Employee_Temp FROM Employee WHERE Id > 1

Insert  Into Temporary Table
SELECT * INTO #MyContacts FROM Employee

How to Find Duplicate Records In Table

SELECT ColumnName,
COUNT(ColumnName) AS ColumnName
FROM tbl_Employee_M
GROUP BY ColumnName
HAVING ( COUNT(ColumnName) > 1 )

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s