Saturday, January 3, 2009

SQL Server: WAITFOR TIME Statement

WAITFOR TIME SQL statement is used to set the particular time to execute the next query/SQL statement.

For Example the second query will execute when the particular time will be reached:

DECLARE @MyDateTime DATETIME
/* Add 5 seconds to current time so
system waits for 15 seconds*/
SET @MyDateTime = DATEADD(s,15,GETDATE())
SELECT GETDATE() CurrentTime
WAITFOR TIME @MyDateTime
SELECT GETDATE() CurrentTime

SQL Server: WAITFOR DELAY Statement to set Delay in Queries

WAITFOR DELAY statement is used in T-SQL to set the delay time between the SQL queries. For example the second query will execute after 10 seconds of delay:

SELECT GETDATE() CurrentTime
WAITFOR DELAY ‘00:00:10′ —- 10 Second Delay
SELECT GETDATE() CurrentTime

Thursday, November 20, 2008

Javascript: Making Initial Letter Capital for text box

Following script will work to make the initial letter in your text box automatically.

I have placed this in onKeyup event, you can use it according to your own requirements.

onkeyup=
"this.value=this.value.substring(0,1).toUpperCase()
+this.value.substring(1,this.value.length)"


Here is the example: