***********************************************************************************
Deleting duplicate records in a table
select DISTINCT * into #temp from table1 --apply where condition
delete from table1
insert table1 select * from #temp
drop table #temp
table names starts with # will truncated and dropped after application end
***********************************************************************************
get day from date sql
datename("dw",getdate())
***********************************************************************************
select getdate()
To convert a given date to normal format
select convert(nvarchar(12),getdate(),103)
***********************************************************************************
Deleting duplicate records in a table
select DISTINCT * into #temp from table1 --apply where condition
delete from table1
insert table1 select * from #temp
drop table #temp
table names starts with # will truncated and dropped after application end
***********************************************************************************
get day from date sql
datename("dw",getdate())
***********************************************************************************
select getdate()
To convert a given date to normal format
select convert(nvarchar(12),getdate(),103)
***********************************************************************************
Comments