get only unique row and delete all duplicate row

delete from table1 where                
EmpID in(select cId from table1 group by cid having count(*) >1)

delete duplicate value in sql server

DELETE
FROM MyTable
WHERE ID NOT IN
(
SELECT MAX(ID)
FROM MyTable
GROUP BY column1,
column)

Rename database in sql 2008



Rename Database in sql server 2008

1.       How to create database in sql server 2008

USE Master;
Go

CREATE DATABASE SALARYMANAGEM;
Go

2.       How  to rename database

ALTER DATABSE SALARYMANAGEM
MODIFY NAME=SALAYMANAGEMANT;
Go
3.       How  to drop database

Drop Database SALAYMANAGEMANT;
Go

Deepak Goyal