All Tips & Questions

Tip of the day

What it means DATEDIFF(DAY, 0, GETDATE())

select DATEDIFF(DAY, 0, GETDATE())

output: 43297

- it will give the number of days from 1900-01-01

select DATEADD(DAY,43297,0)

output: 2012-07-01

- This will adds 43297 days to 1900-01-01

Note: Here 0 means default Start Date which is 1900-01-01

- by

Question of the day

How to apply NOLOCK when querying table using Linked Server?

To Query a table from Linked Server by applying NOLOCK, you have to use an ALIAS for table.

SELECT * FROM [LinkedServer].[Database].[dbo].TABLE_NAME TBL (NOLOCK)

Here TBL is alias name for TABLE_NAME

- by


We are inviting Tips & Questions from you. Click Here to share your valuable Tips & Questions on this website.

  • Your Tips & Questions will be displayed on website, after validating the information you provided.
  • Tips & Questions will be refreshed on every day 12:00 AM IST.