Skip to main content

Posts

Showing posts from November, 2012

Change date format in jquery datepicker

Change date format in jquery datepicker We can change the date format in jquery ui datepicker. <script> $(function() { $("#datepicker1").datepicker({showOn: 'both', buttonImage: 'images/calendar.gif', buttonImageOnly: true, changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'dd-mm-yy', yearRange: '1900:2025' }); }); </script> Demo:Normal JQuery ui datepicker Date: Demo:Changed JQuery ui datepicker Date:

SQL Difference between Union & Union All

SQL Difference between Union & Union All The union and union all operators allow you to combine multiple data sets. The difference between the two is that union sorts the combined set and removes duplicates while union all does not. With union all, the number of rows in the final data set will always equal the sum of the number of rows in the sets being combined.[Learning SQL By Alan Beaulieu] When using the UNION command all selected columns need to be of the same data type. For example : X Y UNION UNION ALL A B A A A B B A B A - B - - - B - - - B - - - A Union all is faster than union, union's duplicate elimination requires a sorting operation, which takes time.

Difference between SQL Truncate & SQL Delete

SQL - Difference between Truncate & Delete 1. TRUNCATE is a DDL (Data Definition Language) command and DELETE is a DML (Data Manipulation Language) command. 2. You can use WHERE clause with DELETE but not with TRUNCATE . 3. You cannot rollback data in TRUNCATE but in DELETE it is possible to rollback data. 4. A trigger doesn't get fired in case of TRUNCATE whereas Triggers get fired in case of a DELETE command. 5. TRUNCATE is faster than DELETE . TRUNCATE is faster than DELETE due to the way TRUNCATE "removes" rows. Actually, TRUNCATE does not remove data, but rather deallocates whole data pages and removes pointers to indexes. The data still exists until it is overwritten or the database is shrunk. This action does not require a lot of resources and is therefore very fast. 6. TRUNCATE resets the Identity counter if there is any identity column present in the table where DELETE does not reset the identity counter. 7. You cannot TRUNCATE a tab...

How to format datetime & date in Sql Server 2005

– Microsoft SQL Server T-SQL date and datetime formats – Date time formats – mssql datetime  – MSSQL getdate returns current system date and time in standard internal format SELECT   convert ( varchar ,   getdate (),  100 )   – mon dd yyyy hh:mmAM (or PM)                                          – Oct  2 2008 11:01AM           SELECT   convert ( varchar ,   getdate (),  101 )   – mm/dd/yyyy  -  10/02/2008                   SELECT   convert ( varchar ,   getdate (),  102 )   – yyyy.mm.dd – 2008.10.02           ...