April 29, 2008

month name in SQL Server 2000

DATENAME ( datepart , date )

DatePart ::

  1. mm month
  2. yy,yyyy year
  3. dd, d day

etc.......

Example :

select datename(mm,getdate())

or

select datename(month,getdate())

April 4, 2008

Magic table or Virtual Table

Magic table is the terminology used for virtual table in SQL Server.

Virtual table holds recently inserted, deleted and updated values during DML operations (insert, delete & update) performed on a database table.
This table automatically created and managed by SQL server internally.
There is two type of virtual table
  •          Inserted
  •         Deleted

Use of virtual tables
Basically, virtual tables are used by triggers     
  1.  Inserted virtual table - The inserted table holds the recently inserted or updated values. It means new data values.
  2.      Deleted virtual table -The Deleted table holds the recently deleted or updated values. It means old data values.