Skip to main content

Posts

SQL

*********************************************************************************** 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) ***********************************************************************************

To invoke a specified application at specified time

This is the windows service which will invoke a application at 5.30 pm Here I am invoking a web page using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.ServiceProcess; using System.Timers; using System.Configuration; using System.Globalization; namespace WinWin { public class WinService1 : System.ServiceProcess.ServiceBase { /// /// Required designer variable. /// /// // private System.Timers.Timer aTimer; private System.ComponentModel.Container components = null; //private System.Timers.Timer aTimer = new System.Timers.Timer(); //private System.ComponentModel.Container components = null; private System.Timers.Timer aTimer; public WinService1() { //System.Timers.Timer aTimer; // This call is required by the Windows.Forms Component Designer. InitializeComponent(); // TODO: Add any initialization after the InitComponent call } // The main entry point for the process //pr