Search This Blog

Thursday, February 2, 2012

Difference between Layer and Tier

Layer corresponds to logical separation of code. A layer typically live within the same process and machine.
Typical Layers include:
1) Presentation Layer
2) Business Layer
3) Data Access Layer

Tier corresponds to physical separation of components i.e, different components like exe, dll, etc are deployed on the same server or multiple servers. Hence it can be said that Tiers are physical deployment of Layers.
Typical Tiers include:
1) Presentation Tier
2) Business Logic Tier
3) Data Tier

Thursday, January 26, 2012

Remove time part from date in SQL Server

If we want to remove time part from the date without converting the date to varchar.

Example:


SELECT GETDATE() gives the Current Date.

i.e, 2012-01-26 23:38:21.983

Now f I want only the date part i.e, 2012-01-26 00:00:00.000.

But I don't want to convert it to varchar.

Below is the code.


SELECT DATEADD(DAY,DATEDIFF(DAY,0,GETDATE()),0)


Output:

2012-01-26 00:00:00.000